diff --git a/app.json b/app.json index add5736..fe53bcf 100644 --- a/app.json +++ b/app.json @@ -1,17 +1,17 @@ { "pages": [ - "pages/index/index", - "pages/login/index", - "pages/market/index", - "pages/user/index", - "pages/coupons/index/index", - "pages/coupons/details/index", - "pages/order/index/index", - "pages/order/details/index", "pages/rushToBuy/index", - "pages/shop/index/index", "pages/shop/details/index", - "pages/success/index" + "pages/shop/index/index", + "pages/market/index", + "pages/coupons/index/index", + "pages/order/details/index", + "pages/coupons/details/index", + "pages/order/index/index", + "pages/user/index", + "pages/success/index", + "pages/login/index", + "pages/index/index" ], "tabBar": { "color":"#9F9F9F", diff --git a/app.wxss b/app.wxss index 51043c3..6c87224 100644 --- a/app.wxss +++ b/app.wxss @@ -88,3 +88,8 @@ view{ font-family: PingFangSC-Semibold; } +page{ + width: 100%; + height: 100%; +} + diff --git a/assets/img/addresslogo.png b/assets/img/addresslogo.png new file mode 100644 index 0000000..c340b57 Binary files /dev/null and b/assets/img/addresslogo.png differ diff --git a/assets/img/food.png b/assets/img/food.png new file mode 100644 index 0000000..8ee9b8b Binary files /dev/null and b/assets/img/food.png differ diff --git a/assets/img/spcode.png b/assets/img/spcode.png new file mode 100644 index 0000000..087c10f Binary files /dev/null and b/assets/img/spcode.png differ diff --git a/assets/img/splogo.png b/assets/img/splogo.png new file mode 100644 index 0000000..b38c6de Binary files /dev/null and b/assets/img/splogo.png differ diff --git a/assets/img/spphone.png b/assets/img/spphone.png new file mode 100644 index 0000000..073c1bb Binary files /dev/null and b/assets/img/spphone.png differ diff --git a/common/common.js b/common/common.js index f01e588..40f8178 100755 --- a/common/common.js +++ b/common/common.js @@ -1,183 +1,184 @@ -const Promise = require('../utils/es6-promise.min').Promise -let config = require("../config/config.js"); -var app = getApp(); -const func = { - wxLogin: function (scene) { - return new Promise((resolve, reject) => { - wx.login({ - success: function (res) { - resolve(res) - }, - fail: function (err) { - reject(err) - }, - complete: function (res) { - //console.log("wxLogin complete:" + res) - } - }) - }) - }, - userLogin: function (code, source) { - return new Promise((resolve, reject) => { - wx.request({ - url: config.api.login, - data: { - appId: app.globalData.appId, - code: code, - scene: scene, - sceneAddress: sceneAddress - }, - method: "POST", - success: function (res) { - resolve(res) - }, - fail: function (err) { - reject(err) - }, - complete: function (res) { - //console.log("userLogin complete:" + res) - } - }) - }) - }, - /** - * 授权后获取用户的昵称,unionId等信息 - */ - getUserInfo: function (encryptedData, iv) { - console.log(app.globalData.openId) - return new Promise((resolve, reject) => { - wx.request({ - url: config.api.getUserInfo, - header: { - "content-type": "application/json;charset=UTF-8", - "token": app.globalData.token - }, - data: { - encryptedData: encryptedData, - iv: iv, - }, - method: "POST", - success: function (res) { - resolve(res) - }, - fail: function (err) { - reject(err) - }, - complete: function (res) { - //console.log("getUserInfo complete:" + res) - } - }) - }) - }, - /** - * 授权后获取用户的手机号 - */ - getUserPhone: function (encryptedData, iv) { - return new Promise((resolve, reject) => { - wx.request({ - url: config.api.getUserPhone + "?token=" + app.globalData.token, - data: { - encryptedData: encryptedData, - iv: iv, - }, - header: { - "content-type": "application/json;charset=UTF-8", - "token": app.globalData.token - }, - method: "POST", - success: function (res) { - resolve(res) - }, - fail: function (err) { - reject(err) - }, - complete: function (res) { - //console.log("getUserInfo complete:" + res) - } - }) - }) - }, - /** - * 优惠券查询 - */ - getCouponList: function (pageNum, pageSize) { - return new Promise((resolve, reject) => { - wx.request({ - url: config.api.couponList, - header: { - "content-type": "application/json;charset=UTF-8", - "token": app.globalData.token - }, - method: "Get", - data: { - pageNum: pageNum, - pageSize: pageSize - }, - success: function (res) { - resolve(res) - }, - fail: function (err) { - reject(err) - }, - complete: function (res) { - console.log(res) - } - }) - }) - }, - /** - * 优惠券详情 - */ - getCouponDetail: function (couponId) { - return new Promise((resolve, reject) => { - wx.request({ - url: config.api.couponDetail, - header: { - "content-type": "application/json;charset=UTF-8", - "token": app.globalData.token - }, - method: "Get", - data: { - id: couponId - }, - success: function (res) { - resolve(res) - }, - fail: function (err) { - reject(err) - }, - complete: function (res) { - console.log(res) - } - }) - }) - }, - /** - * 订单下单 - */ - orderSave: function (couponId) { - return new Promise((resolve, reject) => { - wx.request({ - url: config.api.orderSave, - header: { - "token": app.globalData.token - }, - method: "Post", - data: { - couponId: couponId, - token: app.globalData.token - }, - success: function (res) { - resolve(res) - }, - fail: function (err) { - reject(err) - }, - complete: function (res) { - console.log(res) - } - }) - }) - }, -} +const Promise = require('../utils/es6-promise.min').Promise +let config = require("../config/config.js"); +var app = getApp(); +const func = { + wxLogin: function (scene) { + return new Promise((resolve, reject) => { + wx.login({ + success: function (res) { + resolve(res) + }, + fail: function (err) { + reject(err) + }, + complete: function (res) { + //console.log("wxLogin complete:" + res) + } + }) + }) + }, + /** + * 授权后获取用户的昵称,unionId等信息 + */ + getUserInfo: function (encryptedData, iv) { + console.log(app.globalData.openId) + return new Promise((resolve, reject) => { + wx.request({ + url: config.api.getUserInfo, + header: { + "content-type": "application/json;charset=UTF-8", + "token": app.globalData.token + }, + data: { + encryptedData: encryptedData, + iv: iv, + }, + method: "POST", + success: function (res) { + resolve(res) + }, + fail: function (err) { + reject(err) + }, + complete: function (res) { + //console.log("getUserInfo complete:" + res) + } + }) + }) + }, + /** + * 授权后获取用户的手机号 + */ + getUserPhone: function (encryptedData, iv) { + return new Promise((resolve, reject) => { + wx.request({ + url: config.api.getUserPhone, + data: { + encryptedData: encryptedData, + iv: iv, + }, + header: { + "content-type": "application/json;charset=UTF-8", + "token": app.globalData.token + }, + method: "POST", + success: function (res) { + resolve(res) + }, + fail: function (err) { + reject(err) + }, + complete: function (res) { + //console.log("getUserInfo complete:" + res) + } + }) + }) + }, + /** + * 优惠券查询 + */ + getCouponList: function (pageNum, pageSize) { + return new Promise((resolve, reject) => { + wx.request({ + url: config.api.couponList, + header: { + "content-type": "application/json;charset=UTF-8", + "token": app.globalData.token + }, + method: "Get", + data: { + pageNum: pageNum, + pageSize: pageSize + }, + success: function (res) { + resolve(res) + }, + fail: function (err) { + reject(err) + }, + complete: function (res) { + console.log(res) + } + }) + }) + }, + /** + * 优惠券详情 + */ + getCouponDetail: function (couponId) { + return new Promise((resolve, reject) => { + wx.request({ + url: config.api.couponDetail, + header: { + "content-type": "application/json;charset=UTF-8", + "token": app.globalData.token + }, + method: "Get", + data: { + id: couponId + }, + success: function (res) { + resolve(res) + }, + fail: function (err) { + reject(err) + }, + complete: function (res) { + console.log(res) + } + }) + }) + }, + /** + * 订单下单 + */ + orderSave: function (couponId) { + return new Promise((resolve, reject) => { + wx.request({ + url: config.api.orderSave, + header: { + "token": app.globalData.token + }, + method: "Post", + data: { + couponId: couponId, + token: app.globalData.token + }, + success: function (res) { + resolve(res) + }, + fail: function (err) { + reject(err) + }, + complete: function (res) { + console.log(res) + } + }) + }) + }, + payOrderCreate: function (orderId) { + return new Promise((resolve, reject) => { + wx.request({ + url: config.api.payOrderCreate, + header: { + "token": app.globalData.token + }, + method: "Post", + data: { + orderId: orderId, + token: app.globalData.token + }, + success: function (res) { + resolve(res) + }, + fail: function (err) { + reject(err) + }, + complete: function (res) { + console.log(res) + } + }) + }) + }, +} module.exports = func; \ No newline at end of file diff --git a/config/config.js b/config/config.js index c96a165..5e54a41 100755 --- a/config/config.js +++ b/config/config.js @@ -1,42 +1,50 @@ -var url = 'https://ciformall.youlane.cn' -//var url = 'http://localhost:8001' -var apiPrefix = url + '/C/'; -var config = { - name: "富茂", - api: { - /** - * 接口用途:login - */ - login: '/api/user/login', - /** - * 授权后获取用户的昵称,unionId等信息 - */ - getUserInfo: '/api/user/getUserInfo', - /** - * 接口用途:授权后获取用户的手机号 - */ - getUserPhone: '/api/user/getUserPhone', - /** - * 优惠券查询 - */ - couponList: '/wxCoupon/list', - /** - * 优惠券详情 - */ - couponDetail: '/wxCoupon/findById', - /** - * 下单 - */ - orderSave: '/wxOrder/save', - }, - - weapp: { - AppId: 'wx649b3be73c1afe47', - } -}; - -for (var key in config.api) { - config.api[key] = apiPrefix + config.api[key]; -} - +var url = 'https://ciformall.youlane.cn' +//var url = 'http://localhost:8001' +var apiPrefix = url + '/C/api'; +var config = { + name: "富茂", + api: { + /** + * 接口用途:login + */ + login: '/user/login', + /** + * 授权后获取用户的昵称,unionId等信息 + */ + getUserInfo: '/user/getUserInfo', + /** + * 接口用途:授权后获取用户的手机号 + */ + getUserPhone: '/user/getUserPhone', + /** + * 优惠券查询 + */ + couponList: '/coupon/list', + /** + * 优惠券详情 + */ + couponDetail: '/coupon/findById', + /** + * 下订单 + */ + orderSave: '/order/save', + /** + * 支付订单 + */ + payOrderCreate: '/pay/create', + /** + * 订单列表 + */ + orderSave: '/order/list', + }, + + weapp: { + AppId: 'wx649b3be73c1afe47', + } +}; + +for (var key in config.api) { + config.api[key] = apiPrefix + config.api[key]; +} + module.exports = config; \ No newline at end of file diff --git a/pages/coupons/details/index.js b/pages/coupons/details/index.js index 64c261d..31e3222 100644 --- a/pages/coupons/details/index.js +++ b/pages/coupons/details/index.js @@ -1,41 +1,87 @@ -let Common = require('../../../common/common.js') -var app = getApp() -Page({ - data: { - list:{}, - couponId:null - }, - onLoad(e) { - console.log(e.id) - Common.getCouponDetail(e.id) - .then(res =>{ - console.log(res) - this.setData({ - list: res.data.data, - couponId: e.id - }) - }) - }, - aaa(){ - wx.showLoading({ - title: '加载中...', - }) - console.log(this.data.couponId) - Common.orderSave(''+this.data.couponId) - .then(res => { - wx.hideLoading(); - console.log(res) - if (res.data.code == 200) { - wx.showToast({ - title: '购买成功', - }) - wx.navigateBack({ - delta: 2 - }) - setTimeout(() => { - wx.hideToast(); - }, 2000) - } - }) - } +let Common = require('../../../common/common.js') +var app = getApp() +Page({ + data: { + list:{}, + couponId:null + }, + onLoad(e) { + console.log(e.id) + Common.getCouponDetail(e.id) + .then(res =>{ + console.log(res) + this.setData({ + list: res.data.data, + couponId: e.id + }) + }) + }, + orderfunc(){ + wx.showLoading({ + title: '加载中...', + }) + console.log(this.data.couponId) + Common.orderSave(''+this.data.couponId) + .then(res => { + wx.hideLoading(); + console.log(res) + if (res.data.code == 200) { + Common.payOrderCreate(res.data.data.id) + .then(res =>{ + wx.requestPayment({ + timeStamp: res.data.data.timeStamp, + nonceStr: res.data.data.nonceStr, + package: res.data.data.package, + signType: 'MD5', + paySign: res.data.data.paySign, + 'success': function (res) { + console.log('支付成功'); + wx.showToast({ + title: '购买成功', + duration: 2500 + }) + wx.navigateBack({ + delta: 2 + }) + }, + 'fail': function (res) { + console.log('支付失败'); + console.log(res) + return; + }, + 'complete': function (res) { + console.log('支付完成'); + var url = that.data.url; + console.log('get url', url) + if (res.errMsg == 'requestPayment:ok') { + wx.showModal({ + title: '提示', + content: '支付成功' + }); + if (url) { + setTimeout(function () { + wx.redirectTo({ + url: '/pages' + url + }); + }, 2000) + } else { + setTimeout(() => { + wx.navigateBack() + }, 2000) + } + } + return; + } + }) + + }) + + } else { + wx.showToast({ + title: res.data.message, + duration: 3000 + }) + } + }) + } }) \ No newline at end of file diff --git a/pages/coupons/details/index.wxml b/pages/coupons/details/index.wxml index 8f451b2..5f1f323 100644 --- a/pages/coupons/details/index.wxml +++ b/pages/coupons/details/index.wxml @@ -1,6 +1,46 @@ - - - {{list.subTitle}} - {{list.title}} - - + + + + + 黑椒牛排限购一件 + 剩余时间:2天12小时25分钟 + 剩余件数:19件 + + + ¥1.00 + ¥59.00 + + + + + + 更多适用门店 + + + + + + 购买须知 + + + 有效期2018.01.16 至 2018.09.20 + 除特价酒水及特价菜外全场通用 + 无需预约,消费g高峰时可能需要等位 + 没人最多购买2张 + 不可使用包间 + 堂食外带均可,可免费打包 + 每桌限用2张 + + + + \ No newline at end of file diff --git a/pages/coupons/details/index.wxss b/pages/coupons/details/index.wxss index e69de29..0e93f9d 100644 --- a/pages/coupons/details/index.wxss +++ b/pages/coupons/details/index.wxss @@ -0,0 +1,190 @@ +@import '../../../app.wxss'; + +.coupons { + width: 100%; + height: 100%; + position: absolute; + background: #f6f6f6; +} + +.banner { + width: 100%; + height: 465rpx; +} + +.banner image { + width: 100%; + height: 100%; +} + +.coupons_info { + width: 92%; + height: 186rpx; + display: flex; + justify-content: space-between; + padding: 0 4%; + background: #fff; +} + +.coupons_info view { + display: flex; + flex-direction: column; +} + +.coupons_info view:nth-child(1) text { + font-size: 30rpx; + margin-top: 3%; +} + +.coupons_info view:nth-child(1) text:nth-child(1) text { + color: #ff3434; + font-size: 24rpx; + border: 1px solid #ff3434; + border-radius: 6rpx; + margin-left: 2%; + padding: 0 5rpx; +} + +.coupons_info view:nth-child(1) text:nth-child(2), +.coupons_info view:nth-child(1) text:nth-child(3) { + color: #b8b8b8; + font-size: 24rpx; + margin-top: 4%; +} + +.coupons_info view:nth-child(1) text:nth-child(2) text, +.coupons_info view:nth-child(1) text:nth-child(3) text { + color: #ff3434; + font-size: 24rpx; +} + +.coupons_info view:nth-child(2) text:nth-child(1) { + font-size: 36rpx; + color: #ff3434; + margin-top: 40rpx; + font-weight: bold; +} + +.coupons_info view:nth-child(2) text:nth-child(2) { + font-size: 24rpx; + color: #b4b4b4; + text-decoration: line-through; + padding-left: 10rpx; + padding-top: 4rpx; +} + +.posi { + width: 92%; + display: flex; + flex-direction: column; + padding: 0 4%; + background: #fff; + margin-top: 2%; +} + +.posi>view:nth-child(2) { + width: 100%; + height: 87rpx; + display: flex; + justify-content: space-between; + border-top: 1px solid #f6f6f6; + line-height: 87rpx; +} + +.posi>view:nth-child(2) text:nth-child(1) { + font-size: 30rpx; + color: #a9a9a9; +} + +.posi>view:nth-child(2) text:nth-child(2) { + font-size: 30rpx; + color: #a9a9a9; +} + +.posi_logo { + width: 100%; + height: 156rpx; + display: flex; + margin-top: 30rpx; +} + +.posi_logo view:nth-child(1) { + width: 126rpx; + height: 126rpx; + border-radius: 50%; + overflow: hidden; + flex: 2; +} + +.posi_logo view:nth-child(1) image { + width: 100%; + height: 100%; +} + +.posi_logo view:nth-child(2) { + display: flex; + flex-direction: column; + flex: 8; + padding-top: 20rpx; + padding-left: 30rpx; +} + +.posi_logo view:nth-child(2) text:nth-child(1) { + font-size: 30rpx; +} + +.posi_logo view:nth-child(2) text:nth-child(2) { + font-size: 24rpx; + color: #b8b8b8; + padding-top: 10rpx; +} + +.notes{ + margin-top: 2%; +} +.notes view:nth-child(1){ + width: 92%; + height: 87rpx; + padding: 0 4%; + line-height: 87rpx; + background: #fff; + border-bottom: 1rpx solid #f5f5f5; + border-top: 1rpx solid #f5f5f5; +} +.notes view:nth-child(1) text{ + font-size: 30rpx; + font-weight: bold; +} +.notes view:nth-child(2){ + width: 92%; + height: 400rpx; + padding: 0 4%; + background: #fff; + border-bottom: 1rpx solid #f5f5f5; + display: flex; + flex-direction: column; + padding-top: 2%; +} +.notes view:nth-child(2)>text{ + font-size: 28rpx; + color: #A9A9A9; + line-height: 56rpx; +} +.spot { + width: 12rpx; + height: 12rpx; + display: inline-block; + background: #A9A9A9; + margin-right: 16rpx; + position: relative; + bottom: 4rpx; + border-radius: 50%; +} +.buy { + width: 100%; + height: 88rpx; + background: #00C0FF; + color: #fff; + font-size: 36rpx; + line-height: 88rpx; +} \ No newline at end of file diff --git a/pages/coupons/index/index.js b/pages/coupons/index/index.js index daae2ca..8f85bf8 100644 --- a/pages/coupons/index/index.js +++ b/pages/coupons/index/index.js @@ -1,65 +1,56 @@ Page({ - - /** - * 页面的初始数据 - */ data: { - + tabs: [{ + key: 1, + name: "未使用" + }, + { + key: 2, + name: "已使用" + }, + { + key: 3, + name: "已过期" + }, + { + key: 4, + name: "已退款" + } + ], + list: [{ + key: '1', + data: [{ + name: '111' + }] + }, + { + key: '2', + data: [{ + name: '222' + }] + }, + { + key: '3', + data: [{ + name: '333' + }] + } + ], + current: '', + current_scroll: '1' + }, + handleChange({ + detail + }) { + this.setData({ + current: detail.key + }); + }, + handleChangeScroll({ + detail + }) { + this.setData({ + current_scroll: detail.key + }); }, - - /** - * 生命周期函数--监听页面加载 - */ - onLoad: function (options) { - - }, - - /** - * 生命周期函数--监听页面初次渲染完成 - */ - onReady: function () { - - }, - - /** - * 生命周期函数--监听页面显示 - */ - onShow: function () { - - }, - - /** - * 生命周期函数--监听页面隐藏 - */ - onHide: function () { - - }, - - /** - * 生命周期函数--监听页面卸载 - */ - onUnload: function () { - - }, - - /** - * 页面相关事件处理函数--监听用户下拉动作 - */ - onPullDownRefresh: function () { - - }, - - /** - * 页面上拉触底事件的处理函数 - */ - onReachBottom: function () { - - }, - - /** - * 用户点击右上角分享 - */ - onShareAppMessage: function () { - - } }) \ No newline at end of file diff --git a/pages/coupons/index/index.json b/pages/coupons/index/index.json index 9d95912..656da8f 100644 --- a/pages/coupons/index/index.json +++ b/pages/coupons/index/index.json @@ -1,6 +1,8 @@ { - "usingComponents": { - - }, - "navigationBarTitleText": "我的优惠劵" - } \ No newline at end of file + "usingComponents": { + "i-tab": "../../../dist/tab/index", + "i-tabs": "../../../dist/tabs/index", + "c-coupons": "../../../components/coupons/index" + }, + "navigationBarTitleText": "我的优惠劵" +} \ No newline at end of file diff --git a/pages/coupons/index/index.wxml b/pages/coupons/index/index.wxml index 55f9155..49f19bd 100644 --- a/pages/coupons/index/index.wxml +++ b/pages/coupons/index/index.wxml @@ -1 +1,41 @@ -pages/t/index.wxml + + + + + + + + + + 黑椒牛排 + + + 有效期至:2018-07-10 11:30 + + + 立即使用 + + + + + + + + + + 黑椒牛排 + + + 有效期至:2018-07-10 11:30 + + + 立即使用 + + + + + \ No newline at end of file diff --git a/pages/coupons/index/index.wxss b/pages/coupons/index/index.wxss index e69de29..27b85a4 100644 --- a/pages/coupons/index/index.wxss +++ b/pages/coupons/index/index.wxss @@ -0,0 +1,83 @@ +.market { + width: 100%; + height: 100%; +} + +.tabs { + width: 100% !important; + height: 88rpx; + text-align: center; +} + +.i-tab { + width: 25% !important; + display: inline-block; +} + +.section { + margin-top: 2%; +} + +.detail_msg { + width: 92%; + height: 220rpx !important; + background: #fff; + display: flex; + padding: 0 4%; + margin-top: 2%; + border-bottom: 1px solid #ededed; +} + +.logo { + width: 248rpx; + height: 184rpx; + border-radius: 30rpx; +} + +.logo image { + width: 100%; + height: 100%; +} + +.info view:nth-child(1) { + display: flex; + justify-content: space-between; + padding: 0 4%; +} + +.info { + width: 100%; +} + +.info view:nth-child(1) text { + font-size: 30rpx; +} + +.info view:nth-child(2) { + color: #ff3434; + font-size: 24rpx; + padding-left: 4%; + margin-top: 1%; +} + +.info view:nth-child(2) text { + font-size: 22rpx; + color: #b8b8b8; +} + +.info view:nth-child(3) { + display: flex; + justify-content: space-between; +} + +.info view:nth-child(3) text:nth-child(2) { + width: 170rpx; + height: 50rpx; + color: #fff; + line-height: 50rpx; + text-align: center; + background: #00c0ff; + border-radius: 10px; + font-size: 28rpx; + margin-top: 40rpx; +} diff --git a/pages/market/index.wxml b/pages/market/index.wxml index e629c3d..db5bbc1 100644 --- a/pages/market/index.wxml +++ b/pages/market/index.wxml @@ -4,30 +4,54 @@ - + + - + 黑椒牛排 + 等待付款 - - 黑椒牛排 - 等待付款 - - - 购买数量:1件 - - - 下单时间:2018-07-10 11:30 - + 购买数量:1件 + + 下单时间:2018-07-10 11:30 + + + + + ¥1.00 + ¥59.00 + + + 支付 + + + + + + + + + 黑椒牛排 + 等待付款 + + 购买数量:1件 + + 下单时间:2018-07-10 11:30 + + + + + ¥1.00 + ¥59.00 - ¥1.00 ¥59.90 支付 - \ No newline at end of file diff --git a/pages/market/index.wxss b/pages/market/index.wxss index 3025252..03a0eea 100644 --- a/pages/market/index.wxss +++ b/pages/market/index.wxss @@ -1,33 +1,114 @@ -.market{ +.market { width: 100%; + height: 100%; } -.tabs{ - width: 100%!important; + +.tabs { + width: 100% !important; height: 88rpx; text-align: center; } -.i-tab{ - width: 30%!important; + +.i-tab { + width: 30% !important; display: inline-block; } -.detail_msg{ - width: 100%; - height: 416rpx!important; - background: #fff; +.section { margin-top: 2%; +} +.detail_msg { + width: 92%; + height: 220rpx !important; + background: #fff; display: flex; - flex-direction: column; + margin: 0 4%; + margin-top: 2%; + border-bottom: 1px solid #ededed; } -.detail_msg>view:nth-child(1) { - width: 100%; - height: 244rpx; -} -.detail_msg>view:nth-child(1) view:nth-child(1) { + +.logo { width: 248rpx; height: 184rpx; + border-radius: 30rpx; } -.detail_msg>view:nth-child(1)>view:nth-child(1) image{ + +.logo image { width: 100%; height: 100%; - margin: 13.2% 0 0 13%; -} \ No newline at end of file +} + +.info view:nth-child(1) { + display: flex; + justify-content: space-between; + padding: 0 4%; +} + +.info { + width: 100%; +} + +.info view:nth-child(1) { + margin-bottom: 72rpx; +} + +.info view:nth-child(1) text { + font-size: 30rpx; +} + +.info view:nth-child(1) text:nth-child(2) { + color: #ffae00; + font-size: 24rpx; +} + +.info view:nth-child(2), .info view:nth-child(3) { + color: #ff3434; + font-size: 24rpx; + padding-left: 4%; +} + +.info view:nth-child(2) text, .info view:nth-child(3) text { + font-size: 22rpx; + color: #b8b8b8; +} + +.info view:nth-child(3) { + margin-top: 5rpx; +} + +.payment { + width: 92%; + height: 120rpx; + line-height: 120rpx; + padding: 0 4%; + display: flex; + justify-content: space-between; + border-bottom: 20rpx solid #EDEDED; +} + +.payment view:nth-child(1) text:nth-child(1) { + font-size: 36rpx; + color: #ff3434; + font-weight: bold; +} + +.payment view:nth-child(1) text:nth-child(2) { + font-size: 24rpx; + color: #b4b4b4; + padding-left: 18rpx; + text-decoration: line-through; +} + +.payment view:nth-child(2) { + width: 114rpx; + height: 50rpx; + background: #00c0ff; + border-radius: 10px; + line-height: 38rpx; + text-align: center; + margin-top: 40rpx; +} + +.payment view:nth-child(2) text { + font-size: 28rpx; + color: #fff; +} diff --git a/pages/order/details/index.wxml b/pages/order/details/index.wxml index 55f9155..bf9429c 100644 --- a/pages/order/details/index.wxml +++ b/pages/order/details/index.wxml @@ -1 +1,61 @@ -pages/t/index.wxml + + + + 付款成功,请尽快到门店使用 + + + + + + + 黑椒牛排 + + + 购买数量:1件 + + 下单时间:2018-07-10 11:30 + + + + + + ¥1.00 + ¥59.00 + + + + + + 有效期: + 2018-07-10 至 2018-07-10 + + + 适用门店 + + + + + 兑换码: + 1234567890 + + + + + + + + 下单时间 + 2018-07-10 11:30 + + + 订单编号 + 1234567890 + + + 订单金额 + ¥1.00 + + + \ No newline at end of file diff --git a/pages/order/details/index.wxss b/pages/order/details/index.wxss index e69de29..cbe530f 100644 --- a/pages/order/details/index.wxss +++ b/pages/order/details/index.wxss @@ -0,0 +1,145 @@ +@import '../../../app.wxss'; +.order { + width: 100%; +} +.tips { + width: 92%; + height: 88rpx; + background: #00C0FF; + color: #fff; + padding: 0 4%; + line-height: 88rpx; +} +.tips text:nth-child(2) { + font-size: 24rpx; + padding-left: 16rpx; +} +.tips text:nth-child(1) { + width: 32rpx; + height: 32rpx; + background: #fff; + border-radius: 50%; + color: #00C0FF; + line-height: 32rpx; + text-align: center; + display: inline-block; + font-size: 28rpx; +} +.section { + margin-top: 2%; +} +.detail_msg { + width: 92%; + height: 220rpx !important; + background: #fff; + display: flex; + margin: 0 4%; + margin-top: 2%; + border-bottom: 1px solid #ededed; +} + +.logo { + width: 248rpx; + height: 184rpx; + border-radius: 30rpx; +} + +.logo image { + width: 100%; + height: 100%; +} + +.info view:nth-child(1) { + display: flex; + justify-content: space-between; + padding: 0 4%; +} + +.info { + width: 100%; +} + +.info view:nth-child(1) { + margin-bottom: 72rpx; +} + +.info view:nth-child(1) text { + font-size: 30rpx; +} + +.info view:nth-child(1) text:nth-child(2) { + color: #ffae00; + font-size: 24rpx; +} + +.info view:nth-child(2), .info view:nth-child(3) { + color: #ff3434; + font-size: 24rpx; + padding-left: 4%; +} + +.info view:nth-child(2) text, .info view:nth-child(3) text { + font-size: 22rpx; + color: #b8b8b8; +} + +.info view:nth-child(3) { + margin-top: 5rpx; +} + +.payment { + width: 92%; + height: 120rpx; + line-height: 120rpx; + padding: 0 4%; + display: flex; + justify-content: space-between; + border-bottom: 20rpx solid #EDEDED; +} + +.payment view:nth-child(2) text:nth-child(1) { + font-size: 36rpx; + color: #ff3434; + font-weight: bold; +} + +.payment view:nth-child(2) text:nth-child(2) { + font-size: 24rpx; + color: #b4b4b4; + padding-left: 18rpx; + text-decoration: line-through; +} +.classif { + width: 100%; +} +.classif>view{ + height: 88rpx; + line-height: 88rpx; + display: flex; + justify-content: space-between; + padding-left: 4%; + padding-right: 4%; +} +.classif>view text{ + font-size: 30rpx; +} +.classif>view text:nth-child(2){ + color: #B8B8B8; + font-size: 30rpx; +} +.classif>view:nth-child(1) { + display: block; +} +.classif>view:nth-child(1) text:nth-child(2) { + padding-left: 15rpx; +} +.classif>view:nth-child(3),.classif>view:nth-child(4) { + border-top: 20rpx solid #EDEDED; +} +.classif>view:nth-child(3) view text:nth-child(2) { + padding-left: 15rpx; +} +.classif>view:nth-child(6) text:nth-child(2){ + color: #FF3434; + font-weight: bold; +} \ No newline at end of file diff --git a/pages/rushToBuy/index.json b/pages/rushToBuy/index.json index 2a36d10..8b8550b 100644 --- a/pages/rushToBuy/index.json +++ b/pages/rushToBuy/index.json @@ -3,4 +3,5 @@ }, "navigationBarTitleText": "限时抢购" + } \ No newline at end of file diff --git a/pages/rushToBuy/index.wxml b/pages/rushToBuy/index.wxml index 55f9155..1a9462b 100644 --- a/pages/rushToBuy/index.wxml +++ b/pages/rushToBuy/index.wxml @@ -1 +1,85 @@ -pages/t/index.wxml + + + + + + + + + + + 黑椒牛排 + 小程序专享 + + + ¥1.00 + ¥59.00 + + + + + 剩余时间:2天 12小时25分钟 + + 剩余件数:19件 + 购买 + + + + + + + + + + + + + + 黑椒牛排 + 小程序专享 + + + ¥1.00 + ¥59.00 + + + + + 剩余时间:2天 12小时25分钟 + + 剩余件数:19件 + 购买 + + + + + + + + + + + + + + 黑椒牛排 + 小程序专享 + + + ¥1.00 + ¥59.00 + + + + + 剩余时间:2天12小时25分钟 + + 剩余件数:19件 + 购买 + + + + + + + diff --git a/pages/rushToBuy/index.wxss b/pages/rushToBuy/index.wxss index e69de29..a857ddf 100644 --- a/pages/rushToBuy/index.wxss +++ b/pages/rushToBuy/index.wxss @@ -0,0 +1,104 @@ +.flashSale{ + width: 100%; + height: 100%; + background: #fff; + + +} +.flashSaleItemWrap{ + width: 100%; + height: 410rpx; + border-top: 1rpx solid #ededed; + border-bottom: 1rpx solid #ededed; +} +.flashSaleItem{ + width: 90%; + height: 410rpx; + display: flex; + flex-direction: column; + background: #fff; + margin: 0 auto; +} +.flashSaleItemTop{ + display: flex; + padding-top: 28rpx; + flex-direction:row; + padding-bottom: 25rpx; + border-bottom: 1rpx solid #ededed; + +} +.flashSaleItemTopL{ + flex: 1; +} +.food{ + width: 248rpx; + height: 184rpx; +} +.flashSaleItemTopR{ + flex: 2; + flex-direction: column; + margin-left: 20rpx; + +} +.flashSaleItemTopRTop{ + display: flex; + flex-direction: column; +} +.foodname{ + font-size: 34rpx; + color: #000; +} +.small{ + font-size: 24rpx; + color: #00C0FF; + margin-top: 15rpx; +} +.flashSaleItemTopRBottom{ + margin-top: 50rpx; +} +.presentPrice{ + font-size: 36rpx; + color: #FF3434; +} +.originalPrice{ + margin-left: 20rpx; + color:#B4B4B4; + text-decoration: line-through; + font-size: 24rpx; +} +.flashSaleItemBottom{ + margin-top: 20rpx; +} +.remainingTime{ + font-size: 28rpx; + color: #B4B4B4; +} +.realRemainingTime{ + margin-left: 10rpx; + color:#FF3434; + font-size: 28rpx; +} +.flashSaleItemBottomBottm{ + display: flex; + flex-direction: row; +} +.remainingNumber{ + font-size: 28rpx; + color: #B4B4B4; +} +.realnumber{ + margin-left: 10rpx; + color: #FF3434; + font-size: 28rpx; +} +.buy{ + width:114rpx; + height: 50rpx; + line-height: 50rpx; + text-align: center; + background: #00C0FF; + color: #fff; + border-radius: 10rpx; + margin-left: 350rpx; + font-size: 28rpx; +} \ No newline at end of file diff --git a/pages/shop/details/index.wxml b/pages/shop/details/index.wxml index 55f9155..8120c1a 100644 --- a/pages/shop/details/index.wxml +++ b/pages/shop/details/index.wxml @@ -1 +1,93 @@ -pages/t/index.wxml + + + + + + + IFROMALL (西单大悦城店) + 北京市西城区西单北大街131号 + + + + + + + + 北京市西城区西单北大街131号 + + 12.5km + 到这里去 + + + + + + 门店优惠 + + + + + + 黑椒牛排 + + + ¥1.00 + 59.00 + + + 已售16张 + 购买 + + + + + + + + 黑椒牛排 + + + ¥1.00 + 59.00 + + + 已售16张 + 购买 + + + + + + + + 黑椒牛排 + + + ¥1.00 + 59.00 + + + 已售16张 + 购买 + + + + + + + + 黑椒牛排 + + + ¥1.00 + 59.00 + + + 已售16张 + 购买 + + + + + + \ No newline at end of file diff --git a/pages/shop/details/index.wxss b/pages/shop/details/index.wxss index e69de29..c39c8f0 100644 --- a/pages/shop/details/index.wxss +++ b/pages/shop/details/index.wxss @@ -0,0 +1,174 @@ +.spdetailContainer{ + width: 100%; + height: 100%; + background: #eee; +} +.spheader{ + width: 100%; + height: 186rpx; + background: #fff; + display: flex; + flex-direction: row; +} +.spheaderL{ + flex: 1; + display: flex; + justify-content: center; + align-items: center; +} +.spheaderM{ + flex: 2; + display: flex; + flex-direction: column; + justify-content: left; + align-self: center; +} +.shopname{ + font-size: 31rpx; + color: #000; +} +.shopaddress{ + font-size: 22rpx; + color: #B8B8B8; + margin-top: 20rpx; +} +.spheaderR{ + flex: 1; + display: flex; + justify-content: center; + align-items: center; +} +.splogo{ + width: 150rpx; + height: 150rpx; +} +.spcode{ + width: 100rpx; + height: 100rpx; +} +.spheaderNext{ + width: 100%; + height: 150rpx; + background: #fff; + display: flex; + flex-direction: column; + padding-top: 10rpx; +} +.NextTop{ + margin-left: 30rpx; + font-size: 30rpx; + color: #000; +} +.NextBottom{ + margin-top: 23rpx; + display: flex; + flex-direction: row; + margin-left: 30rpx; +} +.addresslogo{ + width: 20rpx; + height: 20rpx; +} +.spphone{ + width: 44rpx; + height: 44rpx; +} +.NextBottomL{ + flex: 1; + color: #c0c0c0; + font-size: 22rpx; + align-self: center; +} +.NextBottomM{ + flex: 3.5; + justify-content: left; + font-size:22rpx; + color: #00C0FF; + align-self: center; + border-top-width: 2rpx; + border-color: #00C0FF; +} +.NextBottomR{ + flex: .5 +} +.storeDiscount{ + width: 100%; + height: auto; + background: #fff; + margin-top: 30rpx +} +.storeDiscountTitle{ + width: 100%; + height: 87rpx; + line-height: 87rpx; +} +.storeDiscountTitle text{ + margin-left: 30rpx; + font-size:28rpx; + color: #000; + border-bottom: 1px solid #fff; +} +.storeDiscountCon{ + width: 100%; + height: auto; + background: #fff; + flex-direction: column; +} +.storeDiscountConItem{ + width: 100%; + height: 244rpx; + display: flex; + flex-direction: row; +} +.ConItemL{ + flex: 1; + align-self: center; +} +.foodpng{ + width: 248rpx; + height: 184rpx; + margin-left: 30rpx; +} +.ConItemR{ + margin-top: 22rpx; + flex: 4; + padding-left: 20rpx; +} +.ConItemRT{ + color: #000; + font-size: 30rpx; +} +.ConItemRM{ + margin-top: 10rpx; +} +.presentPrice{ + font-size: 36rpx; + color: #FF3434; + margin-right: 20rpx; +} +.originalPrice{ + font-size: 24rpx; + color: #B4B4B4; + text-decoration: line-through; +} +.ConItemRB{ + margin-top: 35rpx; +} +.soldnum{ + color: #585858; + font-size: 22rpx; +} +.buy{ + margin-left: 215rpx; + background: #00C0FF; + color: #fff; + font-size: 28rpx; + width: 114rpx; + height: 50rpx; + line-height: 50rpx; + text-align: center; + border-radius: 10rpx; + display: inline-block; + +} + diff --git a/pages/shop/index/index.js b/pages/shop/index/index.js index daae2ca..96ed282 100644 --- a/pages/shop/index/index.js +++ b/pages/shop/index/index.js @@ -1,65 +1,55 @@ Page({ - - /** - * 页面的初始数据 - */ data: { - + tabs: [{ + key: 1, + name: "全部" + }, + { + key: 2, + name: "待付款" + }, + { + key: 3, + name: "已完成" + } + ], + list: [ + { + key: '1', + data: [ + { + name: '111' + } + ] + }, + { + key: '2', + data: [ + { + name: '222' + } + ] + }, + { + key: '3', + data: [ + { + name: '333' + } + ] + } + ], + current: '', + current_scroll: '1' + }, + handleChange({ detail }) { + this.setData({ + current: detail.key + }); + }, + handleChangeScroll({ detail }) { + this.setData({ + current_scroll: detail.key + }); }, - - /** - * 生命周期函数--监听页面加载 - */ - onLoad: function (options) { - - }, - - /** - * 生命周期函数--监听页面初次渲染完成 - */ - onReady: function () { - - }, - - /** - * 生命周期函数--监听页面显示 - */ - onShow: function () { - - }, - - /** - * 生命周期函数--监听页面隐藏 - */ - onHide: function () { - - }, - - /** - * 生命周期函数--监听页面卸载 - */ - onUnload: function () { - - }, - - /** - * 页面相关事件处理函数--监听用户下拉动作 - */ - onPullDownRefresh: function () { - - }, - - /** - * 页面上拉触底事件的处理函数 - */ - onReachBottom: function () { - - }, - - /** - * 用户点击右上角分享 - */ - onShareAppMessage: function () { - - } }) \ No newline at end of file diff --git a/pages/shop/index/index.json b/pages/shop/index/index.json index 9d95912..ea5b72c 100644 --- a/pages/shop/index/index.json +++ b/pages/shop/index/index.json @@ -1,6 +1,8 @@ { - "usingComponents": { - - }, - "navigationBarTitleText": "我的优惠劵" - } \ No newline at end of file + "usingComponents": { + "i-tab": "../../../dist/tab/index", + "i-tabs": "../../../dist/tabs/index", + "c-coupons": "../../../components/coupons/index" + }, + "navigationBarTitleText": "我的订单" +} \ No newline at end of file diff --git a/pages/shop/index/index.wxml b/pages/shop/index/index.wxml index 55f9155..097d025 100644 --- a/pages/shop/index/index.wxml +++ b/pages/shop/index/index.wxml @@ -1 +1,5 @@ -pages/t/index.wxml + + + + + \ No newline at end of file diff --git a/pages/shop/index/index.wxss b/pages/shop/index/index.wxss index e69de29..20eee2f 100644 --- a/pages/shop/index/index.wxss +++ b/pages/shop/index/index.wxss @@ -0,0 +1,15 @@ +.market { + width: 100%; + height: 100%; +} + +.tabs { + width: 100% !important; + height: 88rpx; + text-align: center; +} + +.i-tab { + width: 30% !important; + display: inline-block; +} \ No newline at end of file diff --git a/pages/success/index.wxml b/pages/success/index.wxml index 55f9155..5c06055 100644 --- a/pages/success/index.wxml +++ b/pages/success/index.wxml @@ -1 +1,9 @@ -pages/t/index.wxml + + + + + + diff --git a/pages/success/index.wxss b/pages/success/index.wxss index e69de29..6001ef7 100644 --- a/pages/success/index.wxss +++ b/pages/success/index.wxss @@ -0,0 +1,47 @@ +.success { + width: 100%; + height: 100%; + background: #f6f6f6; + position: absolute; +} + +.success_logo { + width: 201rpx; + height: 281rpx; + margin: 10% auto; + display: flex; + flex-direction: column; + margin-bottom: 20%; +} + +.success_logo icon { + width: 201rpx; + height: 201rpx; + background: #00c0ff; + border-radius: 50%; + color: #fff; + font-size: 40px; + text-align: center; + line-height: 201rpx; +} + +.success_logo text { + font-size: 36rpx; + text-align: center; + padding-top: 3%; +} + +.success button { + width: 504rpx; + height: 88rpx; + background: #00c0ff; + color: #fff; + margin: 3% auto; + font-size: 36rpx; +} + +.check { + background: #fff!important; + color: #00c0ff!important; + border:1px solid #00c0ff; +} diff --git a/pages/user/index.wxml b/pages/user/index.wxml index b101613..a020fb3 100644 --- a/pages/user/index.wxml +++ b/pages/user/index.wxml @@ -32,7 +32,7 @@ - + 卷包 diff --git a/project.config.json b/project.config.json index eec3456..903995a 100644 --- a/project.config.json +++ b/project.config.json @@ -12,8 +12,8 @@ }, "compileType": "miniprogram", "libVersion": "2.2.2", - "appid": "wx649b3be73c1afe47", - "projectname": "C", + "appid": "wxeaaa53abd537546b", + "projectname": "2222", "isGameTourist": false, "condition": { "search": {