diff --git a/api/interfaces/auth.js b/api/interfaces/auth.js index cc40c2b..8f1c2a3 100644 --- a/api/interfaces/auth.js +++ b/api/interfaces/auth.js @@ -32,9 +32,17 @@ const resetPassword = data => req({ data }) +/** + * 隐私协议 + */ +const richText = id => req({ + url: "cms/pages/" + id +}) + export default ({ Login, register, getSms, - resetPassword + resetPassword, + richText }) \ No newline at end of file diff --git a/api/interfaces/idcard.js b/api/interfaces/idcard.js index 31b1925..e60cb4b 100644 --- a/api/interfaces/idcard.js +++ b/api/interfaces/idcard.js @@ -14,11 +14,16 @@ const updIdcard = (path, data) => upload({ }) // 提交身份信息 -const ocr = data => req({ - url : "user/certification", - data, - method : "POST" -}) +const ocr = data => { + + console.log(data) + + return req({ + url : "user/certification", + data, + method : "POST" + }) +} // 获取认证信息 const getInfo = () => req({ diff --git a/api/request.js b/api/request.js index 5d7bbfa..baffe03 100644 --- a/api/request.js +++ b/api/request.js @@ -6,13 +6,10 @@ import { errInfo } from './err' import { updToken } from './updateToken' -// 请求方式配置 -// //正式地址 -// https://api.xhtest.douhuofalv.com/api/ //测试地址 -// wx989712ad2d06a40b 测试appid 三猿 -// wx7662853c6f7f46b4 正式appid -// 正式环境 -const api = "https://api.xhtest.douhuofalv.com/api/" // 测试环境 +// 正式地址 +const api = "https://api.xuanhuojk.com/api/" +// 测试地址 +// const api = "https://api.xhtest.douhuofalv.com/api/" const header = { "Accept" : "application/json" } diff --git a/app.json b/app.json index 608732b..d5a9a92 100644 --- a/app.json +++ b/app.json @@ -37,7 +37,8 @@ "pages/refund/aftersale/aftersale", "pages/refund/info/info", "pages/refund/deliver/deliver", - "pages/refund/logs/logs" + "pages/refund/logs/logs", + "pages/richText/richText" ], "window": { "backgroundTextStyle": "light", diff --git a/pages/idcard/idcard.js b/pages/idcard/idcard.js index 3b42b86..89feb0a 100644 --- a/pages/idcard/idcard.js +++ b/pages/idcard/idcard.js @@ -76,22 +76,24 @@ Page({ */ onSubmitIdcard(e){ wx.showLoading({ - title: '提交证件信息...', - mask : true + title: '提交证件信息...' + // mask : true }) let { address } = e.detail.value wx.$api.idcard.ocr({ - front_card: this.data.front.path, - back_card : this.data.back.path, + front_card : this.data.front != null ? this.data.front.path : '', + back_card : this.data.back != null ? this.data.back.path : '', address }).then(res => { - let { name, id_card, created_at, verified, need_sign, address } = res.data + let { address, name, id_card, created_at, verified, need_sign, is_sign_contract } = res.data this.setData({ info : { name, id_card, created_at, verified, need_sign, address }, procedure : need_sign ? 2 : 3, - isSignContract : data.is_sign_contract, + isSignContract : is_sign_contract, }) wx.hideLoading() + }).catch(err => { + console.log(err) }) }, /** diff --git a/pages/login/index.js b/pages/login/index.js index aa39580..917b778 100644 --- a/pages/login/index.js +++ b/pages/login/index.js @@ -44,8 +44,6 @@ Page({ password : value.password, } wx.$api.auth.Login(data).then(res => { - // 存储邀请码 - // let { invite, } // 存储登录信息 wx.setStorage({ key : 'token', diff --git a/pages/login/index.wxml b/pages/login/index.wxml index e5f9518..2b74608 100644 --- a/pages/login/index.wxml +++ b/pages/login/index.wxml @@ -8,7 +8,7 @@ - + 忘记密码? @@ -20,6 +20,6 @@ - 我已阅读并同意《隐私协议》《服务协议》 + 我已阅读并同意《隐私协议》《服务协议》 \ No newline at end of file diff --git a/pages/mall/confirm/confirm.js b/pages/mall/confirm/confirm.js index fae8780..f368e3b 100644 --- a/pages/mall/confirm/confirm.js +++ b/pages/mall/confirm/confirm.js @@ -9,16 +9,20 @@ Page({ * 页面的初始数据 */ data: { - disabled : true,//按钮 + disabled : true, //按钮 skuId : '', - goodsQty : '', // 产品数量 - address : '', // 地址 - addressId : '', // 地址id - goodskData : '', // 数据 - amount : '', // 商品总金额 - total : '', // 支付金额 - freight : '', // 运费 - weight : '', // 重量 + goodsQty : '', // 产品数量 + address : '', // 地址 + goodskData : '', // 数据 + amount : '', // 商品总金额 + total : '', // 支付金额 + freight : '', // 运费 + weight : '', // 重量 + distribution : [ + { type: 0, title: "快递" }, + { type: 1, title: "自提" }, + ], + distributionIndex: 0 }, /** @@ -32,30 +36,43 @@ Page({ // 获取商品下单信息 this.placeInfo(options.skuId, options.qty); }, - /** - * 生命周期函数--监听页面显示 + * 配送方式选择 */ - onShow() {}, - + distributionChange(e){ + if(e.detail.value === this.data.distributionIndex) return + this.setData({ + distributionIndex: e.detail.value + }) + this.placeInfo(this.data.skuId, this.data.goodsQty); + }, /** * 商品下单信息 */ - placeInfo(skuid, qty) { + placeInfo(skuid, qty, type) { + wx.showLoading({ + title: '加载中...', + mask : true + }) wx.$api.mall.place({ - goods_sku_id:skuid, - qty: qty, - address_id: this.data.addressId + goods_sku_id : skuid, + qty : qty, + address_id : this.data.address.address_id || '', + delivery_type: this.data.distributionIndex }).then(res => { + if(type != 'chooseAdd'){ + this.setData({ + address: res.data.address, + }) + } this.setData({ - address : res.data.address, - addressId : res.data.address.address_id, goodskData: res.data.detail, amount : res.data.amount, total : res.data.total, freight : res.data.freight, weight : res.data.weight }) + wx.hideLoading() }).catch(err =>{}) }, @@ -70,16 +87,13 @@ Page({ wx.$api.mall.placeTrue({ goods_sku_id : this.data.skuId, qty : this.data.goodsQty, - address_id : this.data.addressId + address_id : this.data.address.address_id, + delivery_type : this.data.distributionIndex }).then(res => { - - console.log(res) - wx.redirectTo({ url: '/pages/pay/index?params=' + encodeURIComponent(JSON.stringify(res.data)) }) - }).catch(() =>{}).finally(() => { wx.hideLoading() - }) + }).catch(() =>{}).finally(() => {}) }, }) \ No newline at end of file diff --git a/pages/mall/confirm/confirm.wxml b/pages/mall/confirm/confirm.wxml index 2ab300f..25a6305 100644 --- a/pages/mall/confirm/confirm.wxml +++ b/pages/mall/confirm/confirm.wxml @@ -1,6 +1,6 @@ - - + + {{address.province.name}}{{address.city.name}} @@ -13,7 +13,7 @@ - 新增收货地址 + + 新增收货地址 + @@ -34,9 +34,19 @@ - + + 配送方式 + + {{distribution[distributionIndex].title}} + + + + + + + 快递 {{freight == 0 ? '免邮' : freight + '元'}} diff --git a/pages/mall/confirm/confirm.wxss b/pages/mall/confirm/confirm.wxss index 5f5d63a..0a4e307 100644 --- a/pages/mall/confirm/confirm.wxss +++ b/pages/mall/confirm/confirm.wxss @@ -10,6 +10,7 @@ page { border-radius: 15rpx; overflow: hidden; position: relative; + margin-bottom: 30rpx; } .address-arrow { @@ -77,7 +78,7 @@ page { .list-goods { background-color: #FFFFFF; - margin: 30rpx 0; + margin: 0 0 30rpx 0; display: flex; padding: 30rpx; border-radius: 15rpx; @@ -124,6 +125,7 @@ page { border-radius: 15rpx; overflow: hidden; box-sizing: border-box; + margin-bottom: 30rpx; } .label-item { @@ -149,6 +151,10 @@ page { flex: 1; } +.label-picker{ width: 70%; } +.label-picker-val{ text-align: right; display: flex; align-items: center; justify-content: flex-end;} +.label-picker-icon{ width: 24rpx; height: 24rpx; margin-left: 10rpx; } + /*checkbox选中后样式 */ .label-text-checkbox { diff --git a/pages/mall/details/details.js b/pages/mall/details/details.js index 63a330a..89b91fc 100644 --- a/pages/mall/details/details.js +++ b/pages/mall/details/details.js @@ -32,8 +32,8 @@ Page({ onLoad(options) { this.setData({ goodsId: options.id, - invite : options.invite || '' }) + getApp().globalData.invite = options.invite || '' }, /** @@ -44,27 +44,95 @@ Page({ this.goodsInfo(); }, + /** + * 输入产品数量 + */ + goodsNumberInput(e){ + let inventory = this.data.selectSkusValues.stock + if(inventory < e.detail.value ){ + wx.showToast({ + title: '超出库存数量', + icon : 'none', + }) + this.setData({ + qtyNumber: Math.min(inventory, e.detail.value) + }) + return + } + this.setData({ + qtyNumber: e.detail.value + }) + }, + /** + * 离开产品数量 + */ + goodsNumberBlur(e){ + let { value } = e.detail + if(value == '' || value <= 0){ + this.setData({ + qtyNumber: 1 + }) + } + }, /** * 商品详情 */ goodsInfo() { + // 因分享朋友圈启动时未挂载全局接口方法,故这里只能使用微信原生方法 wx.showLoading({ title: '加载中...', mask : true }) - wx.$api.mall.goodsSee(this.data.goodsId).then(res => { - this.setData({ - goodsData : res.data, - mallContent : res.data.content.replace(/\{}).finally(() => { - wx.hideLoading() + wx.request({ + url : 'https://api.xhtest.douhuofalv.com/api/mall/goods/' + this.data.goodsId, + header : { + "Accept" : "application/json", + "channel" : "client", + "Authorization" : wx.getStorageSync("token") || "" + }, + success: res => { + wx.hideLoading() + let { statusCode, data } = res + if(statusCode == 200){ + let dataOBJ = data.data + this.setData({ + goodsData : dataOBJ, + mallContent : dataOBJ.content.replace(/\ { + wx.showToast({ + title: err.errMsg, + icon : 'none' + }) + } }) + // wx.$api.mall.goodsSee(this.data.goodsId).then(res => { + // this.setData({ + // goodsData : res.data, + // mallContent : res.data.content.replace(/\{ + // console.log(err) + // }).finally(() => { + // wx.hideLoading() + // }) }, /** @@ -185,11 +253,11 @@ Page({ } = this.data.selectSkusValues; if (stock > 0) { this.setData({ - skuid: sku_id, - goodsSize: false + skuid : sku_id, + goodsSize : false }) wx.navigateTo({ - url: '/pages/mall/confirm/confirm?skuId=' + sku_id + '&qty=' + this.data.qtyNumber + url: '/pages/mall/confirm/confirm?skuId=' + sku_id + '&qty=' + this.data.qtyNumber || 1 }) } else { uni.showToast({ @@ -270,7 +338,7 @@ Page({ onShareTimeline(){ return{ title : this.data.goodsData.name, - query : '/pages/mall/details/details?id=' + this.data.goodsId + '&invite=' + this.data.invite, + query : 'id=' + this.data.goodsId + '&invite=' + this.data.invite, imageUrl : this.data.goodsData.cover } } diff --git a/pages/mall/details/details.wxml b/pages/mall/details/details.wxml index 228da44..87e0843 100644 --- a/pages/mall/details/details.wxml +++ b/pages/mall/details/details.wxml @@ -79,7 +79,7 @@ 数量 - - + + @@ -93,6 +93,6 @@ 抱歉,商品库存不足了 ~ - 立即购买 + \ No newline at end of file diff --git a/pages/mall/details/details.wxss b/pages/mall/details/details.wxss index 628a8b4..f2ab168 100644 --- a/pages/mall/details/details.wxss +++ b/pages/mall/details/details.wxss @@ -404,9 +404,11 @@ button[disabled]{ border-right: 2rpx solid #d7d7d7; } -.goods-size-btn view { +.goods-size-btn button[size="default"] { text-align: center; line-height: 90rpx; + padding: 0; + border-radius: 0; font-size: 28rpx; background: #da2b54; color: white; diff --git a/pages/mall/goods/goods.wxml b/pages/mall/goods/goods.wxml index 31cae34..ded7815 100644 --- a/pages/mall/goods/goods.wxml +++ b/pages/mall/goods/goods.wxml @@ -38,7 +38,7 @@ {{item.description}} ¥{{item.original_price}} - 月销 {{item.sales}} + 浏览 {{item.clicks}} diff --git a/pages/mall/index.js b/pages/mall/index.js index 3cea25f..09c4da2 100644 --- a/pages/mall/index.js +++ b/pages/mall/index.js @@ -25,11 +25,15 @@ Page({ * 生命周期函数--监听页面加载 */ onLoad(options) { - let sceneCode = options.scene || null - if(sceneCode != null ){ - let inviteCode = decodeURIComponent(sceneCode) - let invite = inviteCode.match(new RegExp("(^|&)" + 'invite' + "=([^&]*)(&|$)", "i")); - getApp().globalData.invite = invite[2] || null + if(options.invite){ + getApp().globalData.invite = options.invite || null + }else{ + let sceneCode = options.scene || null + if(sceneCode != null ){ + let inviteCode = decodeURIComponent(sceneCode) + let invite = inviteCode.match(new RegExp("(^|&)" + 'invite' + "=([^&]*)(&|$)", "i")); + getApp().globalData.invite = invite[2] || null + } } }, @@ -170,6 +174,21 @@ Page({ }) }, + /** + * 开通vip + */ + onVip(){ + if(wx.getStorageSync("token") != ''){ + wx.navigateTo({ + url: '/pages/idcard/idcard', + }) + return + } + wx.navigateTo({ + url: "/pages/login/index" + }) + }, + /** * 页面相关事件处理函数--监听用户下拉动作 */ diff --git a/pages/mall/index.wxml b/pages/mall/index.wxml index 6528712..7e00be3 100644 --- a/pages/mall/index.wxml +++ b/pages/mall/index.wxml @@ -45,6 +45,11 @@ + + + + + @@ -123,7 +128,7 @@ {{item.description}} ¥{{item.original_price}} - 游览 {{item.clicks}} + 浏览 {{item.clicks}} diff --git a/pages/order/details/details.wxml b/pages/order/details/details.wxml index 79bd7ea..c21a1ea 100644 --- a/pages/order/details/details.wxml +++ b/pages/order/details/details.wxml @@ -10,13 +10,18 @@ - + {{ goodsData.express.name }} {{ goodsData.express.mobile }} - - {{ goodsData.express.full_address }} - + {{ goodsData.express.full_address }} + + + + + + 提货地址 + {{ goodsData.pickup.address }} @@ -40,45 +45,61 @@ - 订单信息 - 交易时间 + 下单人 + {{goodsData.user.name}} + + + 下单人手机号 + {{goodsData.user.mobile}} + + + 下单时间 {{goodsData.created_at}} - 运费 - {{goodsData.freight == 0 ? '免邮' : goodsData.freight + '元'}} + 付款时间 + {{goodsData.paid_at}} - 交易状态 - {{goodsData.state}} + 配送运费 + {{goodsData.freight == 0 ? '免邮' : goodsData.freight}} + + 订单金额 + {{goodsData.amount}} + + + 实付金额 + ¥{{goodsData.total}} + + - 物流信息 - 物流名称 - {{goodsData.express.express_name}} + 快递公司 + {{goodsData.express.express_name || '-'}} - 物流单号 + 快递单号 - {{goodsData.express.express_no}}复制 + {{goodsData.express.express_no || '-'}}复制 - + diff --git a/pages/order/index.wxml b/pages/order/index.wxml index f80f697..279ea5d 100644 --- a/pages/order/index.wxml +++ b/pages/order/index.wxml @@ -33,12 +33,6 @@ 兑换券兑换 - - - 收货城市 - - {{item.province_city}} - 更多 diff --git a/pages/order/index.wxss b/pages/order/index.wxss index fc37232..cd6cacc 100644 --- a/pages/order/index.wxss +++ b/pages/order/index.wxss @@ -143,6 +143,9 @@ page { .list-operate { display: flex; + margin-top: 20rpx; + padding-top: 30rpx; + border-top: solid 1rpx #f7f8f9; } .list-more { diff --git a/pages/pay/success/success.js b/pages/pay/success/success.js index 632eb27..58740f8 100644 --- a/pages/pay/success/success.js +++ b/pages/pay/success/success.js @@ -27,7 +27,6 @@ Page({ */ getPayState(trade_id){ wx.$api.pay.payState(trade_id).then(res => { - console.log(res.data.is_paid) let { is_paid } = res.data if(is_paid){ this.setData({ diff --git a/pages/refund/aftersale/aftersale.js b/pages/refund/aftersale/aftersale.js index 62a3d79..fa4c8ff 100644 --- a/pages/refund/aftersale/aftersale.js +++ b/pages/refund/aftersale/aftersale.js @@ -20,8 +20,6 @@ Page({ }) wx.$api.refund.refundPreposition(options.id).then(res => { let { title, order } = res.data; - console.log(order) - console.log(title) this.setData({ title, order, @@ -34,7 +32,9 @@ Page({ * 选择退货理由 */ onRadio(e){ - console.log(e.detail.value) + this.setData({ + titleVal: e.detail.value + }) }, /** * 选择图片上传 @@ -65,6 +65,7 @@ Page({ mask : true }) wx.$api.refund.submitRefund(this.data.order.order_no, data).then(res => { + wx.hideLoading() wx.showModal({ title : '提示', content : res.data, @@ -77,6 +78,6 @@ Page({ wx.hideLoading() } }) - }) + }).catch(err => {}) } }) \ No newline at end of file diff --git a/pages/refund/refund.wxml b/pages/refund/refund.wxml index 55bff58..a6714c1 100644 --- a/pages/refund/refund.wxml +++ b/pages/refund/refund.wxml @@ -14,10 +14,13 @@ {{item.state.remark}} - - 取消售后 - 售后详情 - 寄回商品 + + 总退款{{item.refund_total}} + + 取消售后 + 售后详情 + 寄回商品 + diff --git a/pages/refund/refund.wxss b/pages/refund/refund.wxss index e56d48c..1ea948e 100644 --- a/pages/refund/refund.wxss +++ b/pages/refund/refund.wxss @@ -16,8 +16,13 @@ .order-state label{ width: 180rpx; } .order-des { padding-left: 20rpx; color: #777; width: calc(100% - 180rpx); } +/* 退款统计 */ +.order-footer{ display: flex; align-items: center; justify-content: space-between; border-top: solid 1rpx #f9f9f9; padding-top: 20rpx;} +.order-total{ color: #da2b54; font-size: 28rpx; } +.order-total text{ font-weight: bold; padding-left: 5rpx; } + /* 订单操作 */ -.order-btns { border-top: solid 1rpx #f9f9f9; display: flex; justify-content: flex-end; padding-top: 20rpx; } +.order-btns { display: flex; justify-content: flex-end; } .order-btns .item{ font-size: 26rpx; margin-left: 20rpx; color: #da2b54; line-height: 56rpx; border: solid 1rpx #da2b54; padding: 0 20rpx; border-radius: 28rpx; } /* 售后服务 */ diff --git a/pages/register/index.wxss b/pages/register/index.wxss index df77aa4..d2abd54 100644 --- a/pages/register/index.wxss +++ b/pages/register/index.wxss @@ -32,33 +32,29 @@ page { box-sizing: border-box; display: flex; position: relative; + align-items: center; } .inputs input { - width: 100%; height: 100rpx; line-height: 100rpx; border: none; font-size: 32rpx; + flex: 1; } .inputs-see { - position: absolute; - right: 50rpx; - top: 32rpx; width: 38rpx; height: 38rpx; - z-index: 9; + margin-left: 30rpx; } .sms-btn[size='mini'] { font-weight: normal; height: 100rpx; line-height: 100rpx; - position: absolute; - top: 0; - right: 30rpx; margin: 0; + padding: 0 0 0 30rpx; border-radius: 0; border-left: solid 1rpx #f2f2f2; color: #da2b54 !important; diff --git a/pages/resetPassword/resetPassword.wxss b/pages/resetPassword/resetPassword.wxss index 8033194..1ca06c0 100644 --- a/pages/resetPassword/resetPassword.wxss +++ b/pages/resetPassword/resetPassword.wxss @@ -32,33 +32,29 @@ page { box-sizing: border-box; display: flex; position: relative; + align-items: center; } .inputs input { - width: 100%; height: 100rpx; line-height: 100rpx; border: none; font-size: 32rpx; + flex: 1; } .inputs-see { - position: absolute; - right: 50rpx; - top: 32rpx; width: 38rpx; height: 38rpx; - z-index: 9; + margin-left: 30rpx; } .sms-btn[size='mini'] { font-weight: normal; height: 100rpx; line-height: 100rpx; - position: absolute; - top: 0; - right: 30rpx; margin: 0; + padding: 0 0 0 30rpx; border-radius: 0; border-left: solid 1rpx #f2f2f2; color: #da2b54 !important; diff --git a/pages/richText/richText.js b/pages/richText/richText.js new file mode 100644 index 0000000..6254f97 --- /dev/null +++ b/pages/richText/richText.js @@ -0,0 +1,28 @@ +Page({ + + /** + * 页面的初始数据 + */ + data: { + content: "" + }, + + /** + * 生命周期函数--监听页面加载 + */ + onLoad(options) { + wx.showLoading({ + title: '加载中...', + mask : true + }) + wx.$api.auth.richText(options.id).then(res => { + this.setData({ + content: res.data.content + }) + wx.setNavigationBarTitle({ + title: res.data.title, + }) + wx.hideLoading() + }) + } +}) \ No newline at end of file diff --git a/pages/richText/richText.json b/pages/richText/richText.json new file mode 100644 index 0000000..3928faa --- /dev/null +++ b/pages/richText/richText.json @@ -0,0 +1,3 @@ +{ + "usingComponents": {} +} \ No newline at end of file diff --git a/pages/richText/richText.wxml b/pages/richText/richText.wxml new file mode 100644 index 0000000..0ed2621 --- /dev/null +++ b/pages/richText/richText.wxml @@ -0,0 +1,4 @@ + + + + diff --git a/pages/richText/richText.wxss b/pages/richText/richText.wxss new file mode 100644 index 0000000..d7a2023 --- /dev/null +++ b/pages/richText/richText.wxss @@ -0,0 +1,2 @@ + +.content{ padding: 30rpx 50rpx 50rpx; font-size: 30rpx; color: #333; line-height: 50rpx; } diff --git a/pages/site/index.js b/pages/site/index.js index 915b5ce..8418f5e 100644 --- a/pages/site/index.js +++ b/pages/site/index.js @@ -9,8 +9,10 @@ Page({ * 页面的初始数据 */ data: { - type : '', //类型 - listArr : [] //收货地址 + qty : '', // 商品数量 + skuid : '', // skuid + type : '', // 类型 + listArr : [] // 收货地址 }, /** @@ -19,7 +21,9 @@ Page({ onLoad(options) { if(options) { this.setData({ - type: options.type + type : options.type, + qty : options.qty, + skuid : options.skuid }) } }, @@ -40,6 +44,14 @@ Page({ this.setData({ listArr: res.data }) + if(res.data.length <= 0){ + let pages = getCurrentPages(), + prepage = pages[pages.length-2] + prepage.setData({ + address: '' + }) + prepage.placeInfo(this.data.skuid, this.data.qty, "chooseAdd") + } }).catch(err => { }) }, @@ -47,21 +59,14 @@ Page({ * 选择地址 */ selectAddress(e){ - let atAdds = this.data.listArr[e.currentTarget.dataset.index] - let pages = getCurrentPages(), - prepage = pages[pages.length-2] - - if(this.data.type == 'goodsAddress') { - prepage.setData({ - address: atAdds, - addressId: atAdds.address_id - }) - wx.navigateBack() - return - } + let atAdds = e.currentTarget.dataset.obj + let pages = getCurrentPages(), + prepage = pages[pages.length - 2] + prepage.setData({ address: atAdds }) + prepage.placeInfo(this.data.skuid, this.data.qty, "chooseAdd") wx.navigateBack() }, diff --git a/pages/site/index.wxml b/pages/site/index.wxml index 76d0f73..9ca6bc1 100644 --- a/pages/site/index.wxml +++ b/pages/site/index.wxml @@ -13,7 +13,7 @@ - + 选择地址 diff --git a/pages/site/index.wxss b/pages/site/index.wxss index e10027a..59dc3a7 100644 --- a/pages/site/index.wxss +++ b/pages/site/index.wxss @@ -1,7 +1,7 @@ /* 地址列表 */ .list{ padding: 30rpx 0 180rpx; height: 100vh; box-sizing: border-box; background: #f7f8f9; } -.address{ background: white; border-radius: 20rpx; margin: 0 30rpx; } +.address{ background: white; border-radius: 20rpx; margin: 0 30rpx 30rpx; } .address-flex{ display: flex; justify-content: space-between; align-items: center; padding: 30rpx; } .address-icon{ width: 38rpx; height: 38rpx; } .address-btn{ width: 38rpx; height: 38rpx; } diff --git a/pages/user/code/code.js b/pages/user/code/code.js index 40ffeb3..be80706 100644 --- a/pages/user/code/code.js +++ b/pages/user/code/code.js @@ -10,9 +10,11 @@ Page({ */ data: { barHeight : getApp().globalData.barHeight, // 状态栏高度 - shareSee : false, //分享弹出 - inviteText : '', //邀请码 - inviteCode : '', //二维码 + shareSee : false, // 分享弹出 + inviteText : '', // 邀请码 + inviteCode : '', // 二维码 + nickname : '', // 用户名称 + invite : '', // 邀请码 //海报 canvas : '' }, @@ -38,6 +40,7 @@ Page({ onShow() { // 小程序码 this.ShareInfo(); + console.log(wx.getStorageSync("invite")) }, /** @@ -47,12 +50,40 @@ Page({ wx.$api.user.miniShare({ url: 'pages/mall/index' }).then(res => { + let { user_info, qrcode, invite } = res.data this.setData({ - inviteCode: res.data.qrcode + invite : invite, + inviteCode: qrcode, + nickname : user_info.nickname }) }).catch(err => {}) }, + /** + * 检查授权信息 + */ + onSetting(){ + wx.getSetting({ + success: res => { + if(res.authSetting['scope.writePhotosAlbum'] || res.authSetting['scope.writePhotosAlbum'] === undefined){ + this.onCanvas() + return + } + wx.showModal({ + title : '提示', + content : '暂未授权小程序写入您的相册,无法存储海报', + confirmColor: '#144592', + confirmText : '去设置', + success: res => { + if (res.confirm) { + wx.openSetting() + } + } + }) + } + }) + }, + /** * 生成海报 */ @@ -66,9 +97,8 @@ Page({ const codeImgEl = canvas.createImage() const backBackEl = canvas.createImage() - // codeImgEl.src = this.data.inviteCode //二维码 - codeImgEl.src = '/static/imgs/userHead.png' //二维码 - backBackEl.src = 'https://cdn.douhuofalv.com/images/2023/08/11/cd8093d6ab1a248e5154be48b0ddcaac.jpg' //背景素材 + codeImgEl.src = this.data.inviteCode //二维码 + backBackEl.src = 'https://douhuo-storage.oss-cn-beijing.aliyuncs.com/images/2023/08/31/555d989b496e6d68ee8405bcae16555e.jpg' //背景素材 const codeImgLoding = new Promise((resolve, reason) => { codeImgEl.onload = () => { resolve() @@ -83,21 +113,27 @@ Page({ ctx.drawImage(backBackEl, 0, 0, 375, 800) // 绘制[二维码-白色背景] ctx.fillStyle = "#ffffff"; - ctx.fillRect(140, 610, 130, 130); + ctx.fillRect(140, 570, 130, 130); // 绘制[二维码-白色背景黑框] ctx.strokeStyle = "#da2b54"; ctx.lineWidth = 2 - ctx.strokeRect(140, 610, 132, 132); + ctx.strokeRect(140, 570, 132, 132); // 绘制[二维码] - ctx.drawImage(codeImgEl, 150, 620, 110, 110) + ctx.drawImage(codeImgEl, 150, 580, 110, 110) // 文字 ctx.font = "bold 14px Arial"; //字体大小 ctx.fillStyle = "#ffffff"; //字体颜色 ctx.textAlign = "center" - ctx.fillText('保存并分享二维码', 208, 770); + ctx.fillText('保存并分享二维码', 208, 740); + + // 用户昵称 + ctx.font = "bold 14px Arial"; //字体大小 + ctx.fillStyle = "#ffffff"; //字体颜色 + ctx.textAlign = "center" + ctx.fillText(this.data.nickname, 208, 770); wx.hideLoading() wx.canvasToTempFilePath({ @@ -116,22 +152,12 @@ Page({ }, fail: () => { wx.hideLoading() - wx.showModal({ - title: '提示', - content: '暂未授权小程序写入您的相册,无法存储海报', - confirmColor: '#e50d01', - confirmText: '去设置', - success: res => { - if (res.confirm) { - wx.openSetting() - } - } - }) } }) }, }) }).catch(err => { + wx.hideLoading() wx.showToast({ title: '图片加载失败', icon : 'none' @@ -161,9 +187,9 @@ Page({ shareSee: false }) return { - title : '水感应修复、紧致、舒缓喷雾', - path : "/pages/index/index?invite=" + wx.getStorageSync("invite"), - imageUrl: "https://cdn.shuiganying.com/images/2023/04/04/9cd9968136e7efd85028fba69e4c587a.jpg" + title : '绚火健康,生命可以如此精彩~', + path : "/pages/mall/index?invite=" + this.data.invite, + imageUrl: "https://douhuo-storage.oss-cn-beijing.aliyuncs.com/images/2023/08/31/555d989b496e6d68ee8405bcae16555e.jpg" } } }) \ No newline at end of file diff --git a/pages/user/code/code.wxml b/pages/user/code/code.wxml index ef26c17..80be5bc 100644 --- a/pages/user/code/code.wxml +++ b/pages/user/code/code.wxml @@ -6,7 +6,7 @@ - + @@ -30,7 +30,7 @@ 微信好友 - + 保存二维码 diff --git a/pages/user/index.wxml b/pages/user/index.wxml index aed7bd7..d3fb17b 100644 --- a/pages/user/index.wxml +++ b/pages/user/index.wxml @@ -68,9 +68,10 @@ - 我的团队 + 我的市场 + {{userData.refund}} 售后记录 @@ -113,7 +114,7 @@ {{item.description}} ¥{{item.original_price}} - 游览 {{item.clicks}} + 浏览 {{item.clicks}} diff --git a/pages/user/index.wxss b/pages/user/index.wxss index 907f26a..7515164 100644 --- a/pages/user/index.wxss +++ b/pages/user/index.wxss @@ -94,6 +94,19 @@ page { margin: 20rpx 0; } +.order-number{ + position: absolute; + right: 25%; + top: 0; + background: #da2b54; + color: white; + font-size: 22rpx; + min-width: 30rpx; + height: 30rpx; + line-height: 30rpx; + border-radius: 15rpx; +} + .order-icon { width: 52rpx; } diff --git a/pages/user/setup/setup.js b/pages/user/setup/setup.js index 4b58371..bf7cff3 100644 --- a/pages/user/setup/setup.js +++ b/pages/user/setup/setup.js @@ -124,7 +124,6 @@ Page({ if (res.confirm) { // 清理客户端登录缓存 wx.removeStorageSync("token") - wx.switchTab({ url: '/pages/user/index' }) diff --git a/pages/user/team/index.wxml b/pages/user/team/index.wxml index e8b53fd..9c9b7d4 100644 --- a/pages/user/team/index.wxml +++ b/pages/user/team/index.wxml @@ -1,18 +1,18 @@ - 个人当日消费额 + 个人当日销售额 {{perfInfo.day_perf}} - 个人累计消费额 + 个人累计销售额 {{perfInfo.self_perf}} - 个人当日消费额 + 市场业绩 {{perfInfo.group_perf}} @@ -24,7 +24,7 @@ - 团队客户 + 市场客户 {{teamsInfo.group}} @@ -37,19 +37,10 @@ - - - - - 李莉莉 - - - 152****7708 - - - - - 2023-08-18 + + + {{item.nickname || '-'}}{{item.hidden_username || '-'}} + {{item.created_at}} diff --git a/pages/user/team/index.wxss b/pages/user/team/index.wxss index 019dfed..046dfd0 100644 --- a/pages/user/team/index.wxss +++ b/pages/user/team/index.wxss @@ -78,40 +78,37 @@ page { .listItem-item { background-color: #ffffff; border-radius: 20rpx; - padding: 30rpx; + padding: 25rpx 30rpx; box-sizing: border-box; - display: flex; margin-bottom: 30rpx; -} - -.listItem-top { - position: relative; - flex: 1; + display: flex; + align-items: center; } .listItem-head { - width: 100rpx; + width: 88rpx; } .listItem-cont { - position: absolute; - left: 0; - top: 0; - width: 100%; - padding-left: 130rpx; + width: 100% - 88rpx; + padding-left: 30rpx; + box-sizing: border-box; } .listItem-name { font-weight: 600; + line-height: 40rpx; } -.listItem-tel { - margin-top: 20rpx; - color: #666666; +.listItem-name text { + padding-left: 20rpx; + font-weight: normal; } .listItem-time { - line-height: 100rpx; + font-size: 26rpx; + color: gray; + line-height: 40rpx; } diff --git a/pages/withdraw/withdraw.js b/pages/withdraw/withdraw.js index 8355dcf..c1ec902 100644 --- a/pages/withdraw/withdraw.js +++ b/pages/withdraw/withdraw.js @@ -63,11 +63,14 @@ Page({ }) return } - + this.setData({ + bankNo : '', + mobile : '', + bankVal : 0 + }) if(type == 1){ this.setData({ - name : this.data.identity.name, - idcard : this.data.identity.id_card_no + name : this.data.identity.name }) }else{ this.setData({ @@ -127,7 +130,7 @@ Page({ name : valueObj.name, mobileNo : valueObj.mobile, bank_no : valueObj.bankNo, - id_card : valueObj.idcard || '', + id_card : this.data.type == 1 ? this.data.identity.id_card_no : valueObj.idcard || '', message_type: this.data.type, } wx.$api.withdraw.withdraws(data).then(res => { diff --git a/project.private.config.json b/project.private.config.json index 07750c4..ba0737f 100644 --- a/project.private.config.json +++ b/project.private.config.json @@ -3,15 +3,29 @@ "projectname": "%E7%82%AB%E7%81%AB", "setting": { "compileHotReLoad": true, - "urlCheck": true + "urlCheck": false }, "condition": { "miniprogram": { "list": [ + { + "name": "朋友圈进入详情", + "pathName": "pages/mall/details/details", + "query": "id=3&invite=null", + "launchMode": "default", + "scene": 1084 + }, + { + "name": "", + "pathName": "pages/mall/index", + "query": "invite=233232", + "launchMode": "default", + "scene": null + }, { "name": "详情详情", "pathName": "pages/mall/details/details", - "query": "id=4&invite=", + "query": "id=1&invite=2222", "launchMode": "default", "scene": null }, @@ -39,5 +53,5 @@ ] } }, - "libVersion": "2.33.0" + "libVersion": "3.0.0" } \ No newline at end of file diff --git a/static/imgs/capsule.png b/static/imgs/capsule.png index c98a010..1ea3660 100644 Binary files a/static/imgs/capsule.png and b/static/imgs/capsule.png differ diff --git a/static/imgs/vip.png b/static/imgs/vip.png new file mode 100644 index 0000000..b174817 Binary files /dev/null and b/static/imgs/vip.png differ