From c42aab28a12a0c243a3be93bbf9f7d16eaa9fee2 Mon Sep 17 00:00:00 2001 From: stivepeim Date: Fri, 11 Jun 2021 17:41:16 +0800 Subject: [PATCH] =?UTF-8?q?=E5=85=A8=E6=96=B0UI=E8=A7=86=E8=A7=89=E4=BD=93?= =?UTF-8?q?=E9=AA=8C=EF=BC=8C=E7=A7=BB=E5=8A=A8=E7=AB=AFAPI=E4=BC=98?= =?UTF-8?q?=E5=8C=96=E9=99=8D=E4=BD=8E=E9=87=8D=E5=A4=8D=E8=B0=83=E7=94=A8?= =?UTF-8?q?=EF=BC=8C=E6=8F=90=E9=AB=98=E5=B9=B6=E5=8F=916=E5=80=8D?= =?UTF-8?q?=EF=BC=8C=E4=BF=AE=E5=A4=8DN=E5=A4=9ABug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- App.vue | 246 +- api/activity.js | 59 +- api/api.js | 3 - api/order.js | 44 +- api/public.js | 43 +- api/store.js | 46 +- api/user.js | 32 +- components/Authorize.vue | 52 +- components/addressWindow/index.vue | 23 +- components/countDown/index.vue | 50 +- components/couponListWindow/index.vue | 291 +- components/emptyPage.vue | 1 + components/home/index.vue | 2 +- components/login_mobile/index.vue | 215 +- components/login_mobile/routine_phone.vue | 17 +- components/orderGoods/index.vue | 65 +- components/payment/index.vue | 92 +- components/productConSwiper/index.vue | 200 +- components/productWindow/index.vue | 200 +- components/recommend/index.vue | 4 +- components/swipers/index.vue | 2 +- components/userEvaluation/index.vue | 95 +- config/app.js | 4 +- config/cache.js | 2 + libs/apps.js | 24 + libs/login.js | 58 +- libs/order.js | 34 +- libs/routine.js | 30 +- libs/wechat.js | 115 +- main.js | 5 +- manifest.json | 70 +- pages.json | 670 ++- pages/activity/bargain/index.vue | 171 +- pages/activity/goods_bargain/index.vue | 241 +- .../activity/goods_bargain_details/index.vue | 1571 ++++--- pages/activity/goods_combination/index.vue | 288 +- .../goods_combination_details/index.vue | 670 ++- .../goods_combination_status/index.vue | 1679 ++++---- pages/activity/goods_seckill/index.vue | 138 +- .../activity/goods_seckill_details/index.vue | 340 +- pages/activity/poster-poster/index.vue | 3 - pages/activity/static/btn.png | Bin 0 -> 2079 bytes pages/activity/static/canbj.png | Bin 0 -> 30861 bytes pages/activity/static/cheng.png | Bin 0 -> 2005 bytes pages/activity/static/chengh.png | Bin 0 -> 1604 bytes pages/activity/static/lun.png | Bin 0 -> 1298 bytes pages/activity/static/n1.png | Bin 0 -> 1324 bytes pages/activity/static/n2.png | Bin 0 -> 1484 bytes pages/activity/static/n3.png | Bin 0 -> 1500 bytes pages/activity/static/pinbei.png | Bin 0 -> 26307 bytes pages/activity/static/shandian.png | Bin 0 -> 1279 bytes pages/activity/static/woman.png | Bin 0 -> 4495 bytes pages/activity/static/you.png | Bin 0 -> 174 bytes pages/activity/static/you2.png | Bin 0 -> 686 bytes pages/activity/static/zhuangshi.png | Bin 0 -> 929 bytes pages/activity/static/zuo.png | Bin 0 -> 145 bytes pages/activity/static/zuo2.png | Bin 0 -> 662 bytes pages/admin/delivery/index.vue | 358 -- pages/admin/order/index.vue | 268 -- pages/admin/orderDetail/index.vue | 773 ---- pages/admin/orderList/index.vue | 466 --- pages/admin/order_cancellation/index.vue | 323 -- pages/admin/static/scan.gif | Bin 195347 -> 0 bytes pages/admin/statistics/index.vue | 631 --- pages/auth/index.vue | 1 - pages/columnGoods/HotNewGoods/index.vue | 1 - pages/customer_list/chat.vue | 17 +- pages/first_new_product/index.vue | 1 - pages/goods_cate/goods_cate.vue | 94 +- pages/goods_details/index.vue | 3700 +++++++++-------- pages/goods_list/index.vue | 128 +- pages/goods_search/index.vue | 13 +- pages/index/components/a_seckill.vue | 76 +- pages/index/components/b_combination.vue | 166 +- pages/index/components/c_bargain.vue | 55 +- pages/index/index.vue | 1089 +++-- pages/news_details/index.vue | 15 +- pages/news_list/index.vue | 41 +- pages/order_addcart/order_addcart.vue | 640 +-- pages/order_details/index.vue | 466 ++- pages/order_pay_status/index.vue | 28 +- pages/user/index.vue | 464 ++- pages/users/app_login/index.vue | 266 ++ pages/users/commission_rank/index.vue | 21 +- pages/users/goods_comment_con/index.vue | 79 +- pages/users/goods_comment_list/index.vue | 84 +- pages/users/goods_details_store/index.vue | 88 +- pages/users/goods_logistics/index.vue | 46 +- pages/users/goods_return/index.vue | 49 +- pages/users/kefu/index.vue | 34 + pages/users/login/index.vue | 494 ++- pages/users/order_confirm/index.vue | 601 ++- pages/users/order_list/index.vue | 124 +- pages/users/privacy/index.vue | 43 + pages/users/promoter-list/index.vue | 194 +- pages/users/promoter-order/index.vue | 20 +- pages/users/promoter_rank/index.vue | 8 +- pages/users/user_address/index.vue | 158 +- pages/users/user_address_list/index.vue | 104 +- pages/users/user_bill/index.vue | 23 +- pages/users/user_cash/index.vue | 55 +- pages/users/user_coupon/index.vue | 84 +- pages/users/user_get_coupon/index.vue | 316 +- pages/users/user_goods_collection/index.vue | 315 +- pages/users/user_info/index.vue | 145 +- pages/users/user_integral/index.vue | 40 +- pages/users/user_money/index.vue | 38 +- pages/users/user_payment/index.vue | 88 +- pages/users/user_phone/index.vue | 32 +- pages/users/user_pwd_edit/index.vue | 8 +- pages/users/user_return_list/index.vue | 51 +- pages/users/user_sgin/index.vue | 65 +- pages/users/user_sgin_list/index.vue | 14 +- pages/users/user_spread_code/index.vue | 149 +- pages/users/user_spread_money/index.vue | 99 +- pages/users/user_spread_user/index.vue | 22 +- pages/users/user_vip/index.vue | 66 +- pages/users/web_page/index.vue | 37 + pages/users/wechat_login/index.vue | 199 +- static/css/base.css | 54 +- static/css/style.scss | 179 +- static/html/pc.html | 2 +- static/iconfont/iconfont-app.css | 1540 +++++++ static/iconfont/iconfont.css | 799 +++- static/images/1-001.png | Bin 2359 -> 2118 bytes static/images/1-002.png | Bin 2717 -> 2467 bytes static/images/2-001.png | Bin 2480 -> 2064 bytes static/images/2-002.png | Bin 2561 -> 2231 bytes static/images/3-002.png | Bin 2397 -> 2106 bytes static/images/4-001.png | Bin 2193 -> 2006 bytes static/images/4-002.png | Bin 2309 -> 2096 bytes static/images/accountBg.png | Bin 3094 -> 580 bytes static/images/address.png | Bin 2120 -> 784 bytes static/images/alter.png | Bin 1921 -> 535 bytes static/images/angle.png | Bin 2512 -> 817 bytes static/images/balance.png | Bin 2762 -> 1083 bytes static/images/barg001.png | Bin 2307 -> 2306 bytes static/images/bargain.png | Bin 1269 -> 277 bytes static/images/bargainBg.png | Bin 0 -> 10677 bytes static/images/canbj.png | Bin 7956 -> 30164 bytes static/images/code_1.png | Bin 855 -> 389 bytes static/images/code_2.png | Bin 900 -> 401 bytes static/images/collection.png | Bin 2007 -> 749 bytes static/images/coupon.png | Bin 1575 -> 505 bytes static/images/crmeb.png | Bin 2622 -> 1120 bytes static/images/customer.png | Bin 1520 -> 500 bytes static/images/del.png | Bin 1314 -> 671 bytes static/images/dfh.png | Bin 2272 -> 774 bytes static/images/dfk.png | Bin 2130 -> 793 bytes static/images/down.png | Bin 1247 -> 293 bytes static/images/dpj.png | Bin 2112 -> 733 bytes static/images/dsh.png | Bin 2016 -> 704 bytes static/images/edit.png | Bin 437 -> 313 bytes static/images/empty-box.png | Bin 9763 -> 8542 bytes static/images/examine.png | Bin 8970 -> 4132 bytes static/images/explosion-title.png | Bin 3012 -> 1317 bytes static/images/explosion.png | Bin 4862 -> 4266 bytes static/images/extension.png | Bin 1861 -> 648 bytes static/images/f.png | Bin 7127 -> 2251 bytes static/images/face.png | Bin 3370 -> 1125 bytes static/images/gift.png | Bin 5522 -> 2461 bytes static/images/group01.png | Bin 2372 -> 992 bytes static/images/horn.png | Bin 1245 -> 234 bytes static/images/kanjia.png | Bin 0 -> 1513 bytes static/images/keyboard.png | Bin 3058 -> 895 bytes static/images/kjbj.png | Bin 1526 -> 1293 bytes static/images/left.png | Bin 1303 -> 0 bytes static/images/line.jpg | Bin 7042 -> 4560 bytes static/images/ling.png | Bin 1417 -> 339 bytes static/images/lingyhj.png | Bin 0 -> 1430 bytes static/images/live-01.png | Bin 623 -> 399 bytes static/images/live-02.png | Bin 512 -> 398 bytes static/images/live-03.png | Bin 609 -> 476 bytes static/images/lock.png | Bin 3382 -> 897 bytes static/images/lock2.png | Bin 3558 -> 953 bytes static/images/logo.png | Bin 2932 -> 1381 bytes static/images/logo2.png | Bin 9996 -> 4822 bytes static/images/medal01.png | Bin 3140 -> 1593 bytes static/images/medal02.png | Bin 3111 -> 1497 bytes static/images/medal03.png | Bin 3404 -> 1717 bytes static/images/member.png | Bin 2357 -> 1057 bytes static/images/memberCenter.png | Bin 1731 -> 609 bytes static/images/money.png | Bin 7329 -> 3015 bytes static/images/mores.png | Bin 1200 -> 258 bytes static/images/news.png | Bin 2857 -> 1266 bytes static/images/noAddress.png | Bin 9383 -> 8831 bytes static/images/noNews.png | Bin 9215 -> 8640 bytes static/images/noOrder.png | Bin 8773 -> 8165 bytes static/images/noShopper.png | Bin 10333 -> 9942 bytes static/images/one.png | Bin 5004 -> 1983 bytes static/images/order2.png | Bin 1220 -> 273 bytes static/images/order5.png | Bin 1241 -> 311 bytes static/images/orderTime.png | Bin 6428 -> 2016 bytes static/images/phone_1.png | Bin 583 -> 281 bytes static/images/plus.png | Bin 3548 -> 1276 bytes static/images/poster-close.png | Bin 2130 -> 847 bytes static/images/posterbackgd.png | Bin 10139 -> 9645 bytes static/images/priceTag.png | Bin 8602 -> 4102 bytes static/images/pricetitle.jpg | Bin 4010 -> 2317 bytes static/images/pth.png | Bin 3891 -> 3924 bytes static/images/record1.png | Bin 1311 -> 304 bytes static/images/record2.png | Bin 1647 -> 567 bytes static/images/record3.png | Bin 2427 -> 972 bytes static/images/record4.png | Bin 2566 -> 1212 bytes static/images/red-packets.png | Bin 7735 -> 3274 bytes static/images/right-icon.png | Bin 1271 -> 349 bytes static/images/rushBuy.jpg | Bin 3638 -> 1779 bytes static/images/score.png | Bin 5124 -> 3167 bytes static/images/seckillTitle.png | Bin 3306 -> 1534 bytes static/images/sh.png | Bin 4249 -> 2083 bytes static/images/share-info.png | Bin 7947 -> 7766 bytes static/images/shuoming.png | Bin 916 -> 440 bytes static/images/sign03.png | Bin 1547 -> 1135 bytes static/images/spot.png | Bin 1452 -> 373 bytes static/images/stars1.png | Bin 2999 -> 1282 bytes static/images/stars3.png | Bin 2999 -> 900 bytes static/images/stop.png | Bin 7434 -> 1818 bytes static/images/support.png | Bin 6087 -> 2387 bytes static/images/three.png | Bin 5124 -> 1772 bytes static/images/transparent.png | Bin 3403 -> 1575 bytes static/images/two.png | Bin 5071 -> 1865 bytes static/images/up.png | Bin 1248 -> 294 bytes static/images/user_bg.png | Bin 17106 -> 21928 bytes static/images/user_menu08.png | Bin 916 -> 742 bytes static/images/user_menu09.png | Bin 1572 -> 848 bytes static/images/vacancy.png | Bin 4029 -> 1587 bytes static/images/vip.png | Bin 2487 -> 790 bytes static/images/weiling.png | Bin 0 -> 2502 bytes static/images/writeOff.jpg | Bin 5260 -> 4679 bytes static/images/xinjian.png | Bin 0 -> 1562 bytes static/images/xyou.png | Bin 0 -> 343 bytes static/images/xzuo.png | Bin 0 -> 355 bytes static/images/yhjsy.png | Bin 0 -> 12286 bytes store/getters.js | 9 +- store/modules/app.js | 61 +- uni.scss | 5 +- utils/SubscribeMessage.js | 4 - utils/cache.js | 10 + utils/index.js | 3 - utils/request.js | 3 - utils/util.js | 1120 ++--- utils/validate.js | 3 - 242 files changed, 14141 insertions(+), 11619 deletions(-) create mode 100644 libs/apps.js create mode 100644 pages/activity/static/btn.png create mode 100644 pages/activity/static/canbj.png create mode 100644 pages/activity/static/cheng.png create mode 100644 pages/activity/static/chengh.png create mode 100644 pages/activity/static/lun.png create mode 100644 pages/activity/static/n1.png create mode 100644 pages/activity/static/n2.png create mode 100644 pages/activity/static/n3.png create mode 100644 pages/activity/static/pinbei.png create mode 100644 pages/activity/static/shandian.png create mode 100644 pages/activity/static/woman.png create mode 100644 pages/activity/static/you.png create mode 100644 pages/activity/static/you2.png create mode 100644 pages/activity/static/zhuangshi.png create mode 100644 pages/activity/static/zuo.png create mode 100644 pages/activity/static/zuo2.png delete mode 100644 pages/admin/delivery/index.vue delete mode 100644 pages/admin/order/index.vue delete mode 100644 pages/admin/orderDetail/index.vue delete mode 100644 pages/admin/orderList/index.vue delete mode 100644 pages/admin/order_cancellation/index.vue delete mode 100644 pages/admin/static/scan.gif delete mode 100644 pages/admin/statistics/index.vue create mode 100644 pages/users/app_login/index.vue create mode 100644 pages/users/kefu/index.vue create mode 100644 pages/users/privacy/index.vue create mode 100644 pages/users/web_page/index.vue create mode 100644 static/iconfont/iconfont-app.css create mode 100644 static/images/bargainBg.png create mode 100644 static/images/kanjia.png delete mode 100644 static/images/left.png create mode 100644 static/images/lingyhj.png create mode 100644 static/images/weiling.png create mode 100644 static/images/xinjian.png create mode 100644 static/images/xyou.png create mode 100644 static/images/xzuo.png create mode 100644 static/images/yhjsy.png diff --git a/App.vue b/App.vue index c7091916..22b8c0ad 100644 --- a/App.vue +++ b/App.vue @@ -1,74 +1,179 @@ - - diff --git a/components/couponListWindow/index.vue b/components/couponListWindow/index.vue index a7fa2cf7..9df55d8f 100644 --- a/components/couponListWindow/index.vue +++ b/components/couponListWindow/index.vue @@ -1,110 +1,235 @@ diff --git a/components/emptyPage.vue b/components/emptyPage.vue index 17814c3e..0d737d77 100644 --- a/components/emptyPage.vue +++ b/components/emptyPage.vue @@ -24,6 +24,7 @@ justify-content: center; align-items: center; margin-top: 200rpx; + padding-bottom: 60rpx; image{ width: 414rpx; height: 240rpx; diff --git a/components/home/index.vue b/components/home/index.vue index 665f452b..f1b92622 100644 --- a/components/home/index.vue +++ b/components/home/index.vue @@ -73,7 +73,7 @@ border-radius: 50rpx; opacity: 0; height: 0; - color: #e93323; + color: $theme-color; width: 0; } diff --git a/components/login_mobile/index.vue b/components/login_mobile/index.vue index b78d26a6..33a9c4f0 100644 --- a/components/login_mobile/index.vue +++ b/components/login_mobile/index.vue @@ -1,7 +1,7 @@ @@ -18,6 +18,7 @@ const app = getApp(); import sendVerifyCode from "@/mixins/SendVerifyCode"; import Routine from '@/libs/routine'; + import {mapGetters} from "vuex"; import { loginMobile, registerVerify, @@ -26,32 +27,59 @@ phoneSilenceAuth, phoneWxSilenceAuth } from "@/api/user"; - import { bindingPhone } from '@/api/api.js' - import { getUserPhone } from '@/api/public'; - export default{ - name:'login_mobile', - props:{ - isUp:{ - type:Boolean, - default:false, + import { + bindingPhone + } from '@/api/api.js' + import { + getUserPhone, + iosBinding + } from '@/api/public'; + const BACK_URL = "login_back_url"; + export default { + name: 'login_mobile', + computed: mapGetters(['userInfo','isLogin']), + props: { + isUp: { + type: Boolean, + default: false, }, - authKey:{ - type:String, - default:'', + authKey: { + type: String, + default: '', + }, + isShow: { + type: Boolean, + default: true + }, + isPos: { + type: Boolean, + default: true + }, + appleShow: { + type: String, + default: '' + }, + platform: { + type: String, + default: '', } }, - data(){ + data() { return { - keyCode:'', - account:'', - codeNum:'' + keyCode: '', + account: '', + codeNum: '', + isApp: 0 } }, mixins: [sendVerifyCode], mounted() { //this.getCode(); }, - methods:{ + onLoad() { + + }, + methods: { // 获取验证码 async code() { let that = this; @@ -61,12 +89,14 @@ if (!/^1(3|4|5|7|8|9|6)\d{9}$/i.test(that.account)) return that.$util.Tips({ title: '请输入正确的手机号码' }); - await registerVerify(that.account).then(res=>{ - that.$util.Tips({title:res.msg}); + await registerVerify(that.account).then(res => { + that.$util.Tips({ + title: res.msg + }); that.sendCode(); - }).catch(err=>{ + }).catch(err => { return that.$util.Tips({ - title:err + title: err }) }) }, @@ -81,11 +111,11 @@ }); }); }, - close(){ - this.$emit('close',false) + close() { + this.$emit('close', false) }, // 登录 - loginBtn(){ + loginBtn() { let that = this if (!that.account) return that.$util.Tips({ title: '请填写手机号码' @@ -99,47 +129,66 @@ if (!/^[\w\d]+$/i.test(that.codeNum)) return that.$util.Tips({ title: '请输入正确的验证码' }); - uni.showLoading({ title: '正在登录中' }); - getUserPhone({ - captcha: that.codeNum, - phone: that.account, - spid: app.globalData.spid, - spread: app.globalData.code, - type: 'public', - key: this.authKey - }).then(res=>{ - let time = res.data.expires_time - this.$Cache.time(); - this.$store.commit('LOGIN', { - token: res.data.token, - time: time - }); - this.getUserInfo(); - }).catch(error=>{ - uni.hideLoading() - this.$util.Tips({ - title:error + uni.showLoading({ + title: !this.userInfo.phone && this.isLogin?'正在绑定中':'正在登录中' + }); + if (!this.userInfo.phone && this.isLogin) { + iosBinding({ + captcha: that.codeNum, + phone: that.account + }).then(res => { + that.$util.Tips({ + title: '绑定手机号成功', + icon: 'success' + }, { + tab: 3 + }) + that.isApp = 1; + that.getUserInfo(); + }).catch(error => { + uni.hideLoading() + that.$util.Tips({ + title: error + }) }) - }) + } else { + getUserPhone({ + captcha: that.codeNum, + phone: that.account, + // #ifdef H5 + type: 'public', + // #endif + key: that.authKey + }).then(res => { + that.$store.commit('LOGIN', { + token: res.data.token + }); + that.$store.commit("SETUID", res.data.uid); + that.getUserInfo(); + }).catch(error => { + uni.hideLoading() + that.$util.Tips({ + title: error + }) + }) + } }, // #ifdef MP - phoneSilenceAuth(code){ + phoneSilenceAuth(code) { let self = this phoneSilenceAuth({ - code:code, + code: code, spid: app.globalData.spid, spread: app.globalData.code, - phone:this.account, - captcha:this.codeNum - }).then(res=>{ - let time = res.data.expires_time - this.$Cache.time(); - this.$store.commit('LOGIN', { - token: res.data.token, - time: time - }); + phone: this.account, + captcha: this.codeNum + }).then(res => { + this.$store.commit('LOGIN', res.data.token); + this.$store.commit("SETUID", res.data.uid); this.getUserInfo(); - }).catch(error=>{ + }).catch(error => { self.$util.Tips({ - title:error + title: error }) }) }, @@ -151,52 +200,56 @@ let that = this; getUserInfo().then(res => { uni.hideLoading(); - that.userInfo = res.data - that.$store.commit("SETUID", res.data.uid); that.$store.commit("UPDATE_USERINFO", res.data); - // #ifdef MP + // #ifdef MP that.$util.Tips({ - title:'登录成功', - icon:'success' - },{ - tab:3 + title: '登录成功', + icon: 'success' + }, { + tab: 3 }) that.close() // #endif // #ifdef H5 - that.$emit('wechatPhone',true) + that.$emit('wechatPhone', true) // #endif }); }, } } - - diff --git a/components/login_mobile/routine_phone.vue b/components/login_mobile/routine_phone.vue index 4d5b8800..f4082628 100644 --- a/components/login_mobile/routine_phone.vue +++ b/components/login_mobile/routine_phone.vue @@ -20,7 +20,7 @@ getCodeApi, getUserInfo } from "@/api/user"; - import { getLogo, silenceAuth, getUserPhone } from '@/api/public'; + import { getLogo, getUserPhone } from '@/api/public'; export default{ name:'routine_phone', props:{ @@ -51,7 +51,6 @@ // #ifdef MP // 小程序获取手机号码 getphonenumber(e){ - console.log(e) uni.showLoading({ title: '加载中' }); Routine.getCode() .then(code => { @@ -67,22 +66,21 @@ encryptedData: encryptedData, iv: iv, code: code, - spid: app.globalData.spid, - spread: app.globalData.code, key:this.authKey, type: 'routine' }) .then(res => { - let time = res.data.expires_time - this.$Cache.time(); this.$store.commit('LOGIN', { - token: res.data.token, - time: time + token: res.data.token }); + this.$store.commit("SETUID", res.data.uid); this.getUserInfo(); }) .catch(res => { - console.log(res); uni.hideLoading(); + this.$util.Tips({ + title: res + }); }); }, /** @@ -93,7 +91,6 @@ getUserInfo().then(res => { uni.hideLoading(); that.userInfo = res.data - that.$store.commit("SETUID", res.data.uid); that.$store.commit("UPDATE_USERINFO", res.data); that.isStatus = true this.close() @@ -150,7 +147,7 @@ height: 86rpx; line-height: 86rpx; margin-top: 60rpx; - background: #E93323; + background: $theme-color; border-radius: 43rpx; color: #fff; font-size: 28rpx; diff --git a/components/orderGoods/index.vue b/components/orderGoods/index.vue index ad5fb318..db27710b 100644 --- a/components/orderGoods/index.vue +++ b/components/orderGoods/index.vue @@ -1,26 +1,27 @@ diff --git a/components/productWindow/index.vue b/components/productWindow/index.vue index 1aaa9367..2beaa8d5 100644 --- a/components/productWindow/index.vue +++ b/components/productWindow/index.vue @@ -1,6 +1,7 @@ @@ -45,6 +49,8 @@ import { toLogin } from '@/libs/login.js'; + import home from '@/components/home'; + import emptyPage from '@/components/emptyPage.vue' import { mapGetters } from "vuex"; @@ -53,6 +59,8 @@ // #endif export default { components: { + emptyPage, + home, // #ifdef MP authorize // #endif @@ -90,13 +98,7 @@ this.getBrokerageRankList(); this.getBrokerageRankNumber(this.type); } else { - // #ifdef H5 || APP-PLUS toLogin(); - // #endif - // #ifdef MP - this.isAuto = true; - this.$set(this, 'isShowAuth', true); - // #endif } }, methods: { @@ -179,7 +181,7 @@ .CommissionRank .wrapper { width: 710rpx; background-color: #fff; - border-radius: 20rpx; + border-radius: 14rpx; margin: -76rpx auto 0 auto; } @@ -193,7 +195,8 @@ } .CommissionRank .wrapper .nav .item.font-color { - border-bottom: 4rpx solid #e93323; + border-bottom: 4rpx solid $theme-color; + margin-top: -2rpx; } .CommissionRank .wrapper .list { diff --git a/pages/users/goods_comment_con/index.vue b/pages/users/goods_comment_con/index.vue index 4294b6a5..5a277703 100644 --- a/pages/users/goods_comment_con/index.vue +++ b/pages/users/goods_comment_con/index.vue @@ -1,24 +1,27 @@ @@ -103,26 +106,19 @@ } }, onLoad(options) { - if (!options.unique || !options.uni || !options.id) return this.$util.Tips({ + if (!options.unique || !options.orderId ) return this.$util.Tips({ title: '缺少参数' }, { tab: 3, url: 1 }); - this.unique = options.unique; - this.orderId = options.uni; - this.id = options.id; - this.evaluateId = options.id; + this.unique = Number(options.unique) || 0; + this.orderId = options.orderId || 0; + this.evaluateId = Number(options.id) || 0; if (this.isLogin) { this.getOrderProduct(); } else { - // #ifdef H5 || APP-PLUS toLogin(); - // #endif - // #ifdef MP - this.isAuto = true; - this.$set(this, 'isShowAuth', true); - // #endif } }, methods: { @@ -140,12 +136,12 @@ getOrderProduct: function() { let that = this; orderProduct({ - orderId: that.id, + orderId: that.evaluateId, uni: that.unique }).then(res => { - that.$set(that, 'productInfo', res.data.productInfo); - that.$set(that, 'cart_num', res.data.cartNum); - that.$set(that, 'productId', res.data.productId); + that.$set(that, 'productInfo', res.data); + // that.$set(that, 'cart_num', res.data.cartNum); + // that.$set(that, 'productId', res.data.productId); }); }, stars: function(indexn, indexw) { @@ -159,7 +155,7 @@ let that = this, pic = this.picsPath[index]; that.picsPath.splice(index, 1); - that.$set(that, 'picsPath', that.picsPath); + that.pics.splice(index, 1); }, /** @@ -196,10 +192,10 @@ value.productScore = product_score; value.serviceScore = service_score; value.pics = that.pics.length>0?JSON.stringify(that.pics):''; - value.productId = that.productId; - value.oid = that.evaluateId; + value.productId = that.productInfo.productId; + value.orderNo = that.orderId; value.unique = that.unique; - value.sku = that.productInfo.attrInfo.suk; + value.sku = that.productInfo.sku; uni.showLoading({ title: "正在发布评论……" }); @@ -221,16 +217,23 @@ diff --git a/pages/users/goods_details_store/index.vue b/pages/users/goods_details_store/index.vue index 3f3c353b..a9f4e87c 100644 --- a/pages/users/goods_details_store/index.vue +++ b/pages/users/goods_details_store/index.vue @@ -12,32 +12,36 @@
- + - - + +
- 距离{{ item.range }}千米 + 距离{{ item.distance/1000 }}千米 查看地图
+ +
- + -->
@@ -111,29 +115,60 @@ }, selfLocation() { let self = this - uni.getLocation({ - type: 'wgs84', - success: function(res) { - try { - uni.setStorageSync('user_latitude', res.latitude); - uni.setStorageSync('user_longitude', res.longitude); - } catch {} + // #ifdef H5 + if (self.$wechat.isWeixin()) { + self.$wechat.location().then(res => { + this.user_latitude = res.latitude; + this.user_longitude = res.longitude; + uni.setStorageSync('user_latitude', res.latitude); + uni.setStorageSync('user_longitude', res.longitude); self.getList(); - }, - complete:function() { - self.getList(); - } - }); + }) + } else { + // #endif + uni.getLocation({ + type: 'wgs84', + success: (res) => { + try { + this.user_latitude = res.latitude; + this.user_longitude = res.longitude; + uni.setStorageSync('user_latitude', res.latitude); + uni.setStorageSync('user_longitude', res.longitude); + } catch {} + self.getList(); + }, + complete: function() { + self.getList(); + } + }); + // #ifdef H5 + } + // #endif }, showMaoLocation(e) { - uni.openLocation({ - latitude: Number(e.latitude), - longitude: Number(e.longitude), - success: function() { + let self = this; + // #ifdef H5 + if (self.$wechat.isWeixin()) { + self.$wechat.seeLocation({ + latitude: Number(e.latitude), + longitude: Number(e.longitude) + }).then(res => { console.log('success'); - Number - } - }); + }) + } else { + // #endif + uni.openLocation({ + latitude: Number(e.latitude), + longitude: Number(e.longitude), + name: e.name, + address: `${e.address}-${e.detailedAddress}`, + success: function() { + console.log('success'); + } + }); + // #ifdef H5 + } + // #endif }, // 选中门店 checked(e) { @@ -241,9 +276,10 @@ border-radius: 50%; display: block; text-align: center; - line-height: 50rpx; + line-height: 48rpx; background-color: #e83323; margin-bottom: 22rpx; + text-decoration: none; } .store-distance { diff --git a/pages/users/goods_logistics/index.vue b/pages/users/goods_logistics/index.vue index 957f8328..7155ddd1 100644 --- a/pages/users/goods_logistics/index.vue +++ b/pages/users/goods_logistics/index.vue @@ -3,13 +3,13 @@ - + - {{product.productInfo.storeName}} + {{product.productName}} - ¥{{product.truePrice}} - x{{product.cartNum}} + ¥{{product.price}} + x{{product.payNum}} @@ -40,7 +40,7 @@ - + @@ -106,13 +106,7 @@ this.getExpress(); this.get_host_product(); } else { - // #ifdef H5 || APP-PLUS toLogin(); - // #endif - // #ifdef MP - this.isAuto = true; - this.$set(this, 'isShowAuth', true); - // #endif } }, onReady: function() { @@ -142,30 +136,11 @@ let that=this; express(that.orderId).then(function(res){ let result = res.data.express|| {}; - that.$set(that,'product',res.data.order.cartInfo[0] || {}); + that.$set(that,'product',res.data.order.info[0] || {}); that.$set(that,'orderInfo',res.data.order); that.$set(that,'expressList',result.list || []); }); }, - /** - * 获取我的推荐 - */ - // getGroomList(onloadH) { - // this.loading = true - // if (!this.goodScroll) return - // if (onloadH) { - // this.iSshowH = true - // } - // getGroomList(type, this.params).then(({ - // data - // }) => { - // this.iSshowH = false - // this.loading = false - // this.goodScroll = data.list.length >= this.params.limit - // this.params.page++ - // this.tempArr = this.tempArr.concat(data.list) - // }) - // } get_host_product: function () { this.loading = true if (!this.goodScroll) return @@ -176,7 +151,6 @@ that.goodScroll = res.data.list.length >= that.params.limit that.params.page++ that.hostProduct = that.hostProduct.concat(res.data.list) - // that.$set(that,'hostProduct',res.data.list); }); }, }, @@ -271,7 +245,7 @@ height: 40rpx; text-align: center; line-height: 40rpx; - border-radius: 3rpx; + border-radius: 20rpx; border: 1rpx solid #999; } @@ -291,15 +265,15 @@ } .logistics .logisticsCon .item .circular.on { - background-color: #e93323; + background-color: $theme-color; } .logistics .logisticsCon .item .text.on-font { - color: #e93323; + color: $theme-color; } .logistics .logisticsCon .item .text .data.on-font { - color: #e93323; + color: $theme-color; } .logistics .logisticsCon .item .text { diff --git a/pages/users/goods_return/index.vue b/pages/users/goods_return/index.vue index 1f9c6579..a09e1ee2 100644 --- a/pages/users/goods_return/index.vue +++ b/pages/users/goods_return/index.vue @@ -2,21 +2,17 @@
- - + + - {{item.info.productInfo.storeName}} - - ¥{{item.info.productInfo.attrInfo.price}} - x{{item.info.cartNum}} - - - ¥{{item.info.productInfo.price}} - x{{item.info.cartNum}} + {{item.storeName}} + + ¥{{item.price}} + x{{item.cartNum}} - + 退货件数 {{orderInfo.totalNum}} @@ -38,7 +34,7 @@ 备注说明 - + 上传凭证 ( 最多可上传3张 ) @@ -54,17 +50,17 @@ + - - + diff --git a/pages/users/kefu/index.vue b/pages/users/kefu/index.vue new file mode 100644 index 00000000..1c539f96 --- /dev/null +++ b/pages/users/kefu/index.vue @@ -0,0 +1,34 @@ + + + diff --git a/pages/users/login/index.vue b/pages/users/login/index.vue index ecd413ad..7b2753eb 100644 --- a/pages/users/login/index.vue +++ b/pages/users/login/index.vue @@ -1,47 +1,37 @@ @@ -126,7 +76,7 @@ validatorDefaultCatch } from "@/utils/dialog"; import { - getLogo + getLogo, appAuth, appleLogin } from "@/api/public"; import { VUE_APP_API_URL @@ -140,7 +90,7 @@ data: function() { return { navList: ["快速登录", "账号登录"], - current: 0, + current: 1, account: "", password: "", captcha: "", @@ -150,7 +100,13 @@ keyCode: "", codeUrl: "", codeVal: "", - isShowCode: false + isShowCode: false, + platform: '', + appLoginStatus: false, // 微信登录强制绑定手机号码状态 + appUserInfo: null, // 微信登录保存的用户信息 + appleLoginStatus: false, // 苹果登录强制绑定手机号码状态 + appleUserInfo: null, + appleShow: false // 苹果登录版本必须要求ios13以上的 }; }, watch:{ @@ -166,7 +122,143 @@ this.getCode(); this.getLogoImage(); }, + onLoad() { + let self = this + uni.getSystemInfo({ + success: function(res) { + if (res.platform.toLowerCase() == 'ios' && res.system.split(' ')[1] >= 13) { + self.appleShow = true + } + } + }); + }, methods: { + // 苹果登录 + appleLogin() { + let self = this + this.account = '' + this.captcha = '' + uni.showLoading({ + title: '登录中' + }) + uni.login({ + provider: 'apple', + timeout: 10000, + success(loginRes) { + uni.getUserInfo({ + provider: 'apple', + success: function(infoRes) { + self.appleUserInfo = infoRes.userInfo + self.appleLoginApi() + }, + fail() { + uni.hideLoading() + uni.showToast({ + title: '获取用户信息失败', + icon: 'none', + duration: 2000 + }) + }, + complete() { + uni.hideLoading() + } + }); + }, + fail(error) { + uni.hideLoading() + console.log(error) + } + }) + }, + // 苹果登录Api + appleLoginApi() { + let self = this + appleLogin({ + openId: self.appleUserInfo.openId, + email: self.appleUserInfo.email == undefined ? '' :self.appleUserInfo.email, + identityToken: self.appleUserInfo.identityToken || '' + }).then((res) => { + this.$store.commit("LOGIN", { + 'token': res.data.token + }); + this.getUserInfo(res.data); + }).catch(error => { + uni.hideLoading(); + uni.showModal({ + title: '提示', + content: `错误信息${error}`, + success: function(res) { + if (res.confirm) { + console.log('用户点击确定'); + } else if (res.cancel) { + console.log('用户点击取消'); + } + } + }); + }) + }, + // App微信登录 + wxLogin() { + let self = this + this.account = '' + this.captcha = '' + uni.showLoading({ + title: '登录中' + }) + uni.login({ + provider: 'weixin', + success: function(loginRes) { + // 获取用户信息 + uni.getUserInfo({ + provider: 'weixin', + success: function(infoRes) { + uni.hideLoading(); + self.appUserInfo = infoRes.userInfo + self.appUserInfo.type = self.platform === 'ios' ? 'iosWx' : 'androidWx' + self.wxLoginGo(self.appUserInfo) + }, + fail() { + uni.hideLoading(); + uni.showToast({ + title: '获取用户信息失败', + icon: 'none', + duration: 2000 + }) + }, + complete() { + uni.hideLoading() + } + }); + }, + fail() { + uni.hideLoading() + uni.showToast({ + title: '登录失败', + icon: 'none', + duration: 2000 + }) + } + }); + }, + wxLoginGo(userInfo) { + appAuth(userInfo).then(res => { + if (res.data.type === 'register') { + uni.navigateTo({ + url: '/pages/users/app_login/index?authKey='+res.data.key + }) + } + if (res.data.type === 'login') { + this.$store.commit("LOGIN", { + 'token': res.data.token + }); + this.getUserInfo(res.data); + } + }).catch(res => { + that.$util.Tips({ + title: res + }); + }); + }, again() { this.codeUrl = VUE_APP_API_URL + @@ -177,20 +269,11 @@ }, getCode() { let that = this - // getCodeApi() - // .then(res => { - // that.keyCode = res.data.key; - // }) - // .catch(res => { - // that.$util.Tips({ - // title: res - // }); - // }); }, async getLogoImage() { let that = this; getLogo().then(res => { - that.logoUrl = res.data.logoUrl; + that.logoUrl = res.data.logoUrl?res.data.logoUrl:'/static/images/logo2.png'; }); }, async loginMobile() { @@ -208,34 +291,17 @@ title: '请输入正确的验证码' }); loginMobile({ - account: that.account, + phone: that.account, captcha: that.captcha, - spread: that.$Cache.get("spread") + spread_spid: that.$Cache.get("spread") }) .then(res => { let data = res.data; let newTime = Math.round(new Date() / 1000); - that.$store.commit("LOGIN", { - 'token': data.token - // 'time': dayjs(data.expiresTime) - newTime + this.$store.commit("LOGIN", { + 'token': res.data.token }); - const backUrl = that.$Cache.get(BACK_URL) || "/pages/index/index"; - that.$Cache.clear(BACK_URL); - // getUserInfo().then(res => { - that.$store.commit("SETUID", res.data.user.uid); - if (backUrl === '/pages/index/index' || backUrl === '/pages/order_addcart/order_addcart' || backUrl === - '/pages/user/index') { - - uni.switchTab({ - url: backUrl - }); - - } else { - uni.switchTab({ - url: '/pages/index/index' - }); - } - // }) + that.getUserInfo(data); }) .catch(res => { that.$util.Tips({ @@ -290,21 +356,15 @@ title: '请输入正确的手机号码' }); if (that.formItem == 2) that.type = "register"; - // phone: that.account - // type: that.type, - // key: that.keyCode, - // code: that.codeVal await registerVerify(that.account) .then(res => { that.$util.Tips({title:res.message}); that.sendCode(); }) - .catch(res => { - // if (res.data.status === 402) { - // that.codeUrl = `${VUE_APP_API_URL}/sms_captcha?key=${that.keyCode}`; - // that.isShowCode = true; - // } - that.$util.Tips({title:res.message}); + .catch(err => { + return that.$util.Tips({ + title: err + }); }); }, navTap: function(index) { @@ -329,44 +389,210 @@ .then(({ data }) => { - // let newTime = Math.round(new Date() / 1000); - that.$store.commit("LOGIN", { + this.$store.commit("LOGIN", { 'token': data.token - // 'time': dayjs(data.expiresTime) - newTime }); - const backUrl = that.$Cache.get(BACK_URL) || "/pages/index/index"; - that.$Cache.clear(BACK_URL); - getUserInfo().then(res => { - that.$store.commit("SETUID", res.data.uid); - if (backUrl === '/pages/index/index' || backUrl === '/pages/order_addcart/order_addcart' || backUrl ==='/pages/user/index') { - uni.switchTab({ - url: backUrl - }); - } else { - uni.switchTab({ - url: '/pages/index/index' - }); - } - }) + that.getUserInfo(data); }) .catch(e => { that.$util.Tips({ title: e }); }); + }, + getUserInfo(data){ + this.$store.commit("SETUID", data.uid); + getUserInfo().then(res => { + this.$store.commit("UPDATE_USERINFO", res.data); + let backUrl = this.$Cache.get(BACK_URL) || "/pages/index/index"; + if (backUrl.indexOf('/pages/users/login/index') !== -1) { + backUrl = '/pages/index/index'; + } + uni.reLaunch({ + url: backUrl + }); + }) } } }; - \ No newline at end of file + + .login-wrapper { + padding: 30rpx; + + .shading { + display: flex; + align-items: center; + justify-content: center; + width: 100%; + + /* #ifdef APP-VUE */ + margin-top: 50rpx; + /* #endif */ + /* #ifndef APP-VUE */ + + margin-top: 200rpx; + /* #endif */ + + + image { + width: 180rpx; + height: 180rpx; + } + } + + .whiteBg { + margin-top: 100rpx; + + .list { + border-radius: 16rpx; + overflow: hidden; + + .item { + border-bottom: 1px solid #F0F0F0; + background: #fff; + + .row-middle { + position: relative; + padding: 16rpx 45rpx; + + .texts{ + flex: 1; + font-size: 28rpx; + height: 80rpx; + line-height: 80rpx; + display: flex; + justify-content: center; + align-items: center; + } + + input { + flex: 1; + font-size: 28rpx; + height: 80rpx; + line-height: 80rpx; + display: flex; + justify-content: center; + align-items: center; + } + + .code { + position: absolute; + right: 30rpx; + top: 50%; + color: $theme-color; + font-size: 26rpx; + transform: translateY(-50%); + } + } + } + } + + .logon { + display: flex; + align-items: center; + justify-content: center; + width: 100%; + height: 86rpx; + margin-top: 80rpx; + background-color: $theme-color; + border-radius: 120rpx; + color: #FFFFFF; + font-size: 30rpx; + } + + .tips { + margin: 30rpx; + text-align: center; + color: #999; + } + } + } + diff --git a/pages/users/order_confirm/index.vue b/pages/users/order_confirm/index.vue index 2af35f46..33043e6a 100644 --- a/pages/users/order_confirm/index.vue +++ b/pages/users/order_confirm/index.vue @@ -1,17 +1,23 @@ diff --git a/pages/users/promoter-list/index.vue b/pages/users/promoter-list/index.vue index 13eeff3f..7399028b 100644 --- a/pages/users/promoter-list/index.vue +++ b/pages/users/promoter-list/index.vue @@ -2,74 +2,84 @@ - + 推广人数 - {{teamCount}} + {{peopleData.count}} - - 一级({{total}}) - 二级({{totalLevel}}) - - - - - - - - 团队排序 - - - 团队排序 - - - 团队排序 - - - 金额排序 - - - 金额排序 - - - 金额排序 - - - 订单排序 - - - 订单排序 - - - 订单排序 - + + + 一级({{peopleData.total}}) + 二级({{peopleData.totalLevel}}) - - - - - - - - {{item.nickname}} - 加入时间: {{item.time}} - + + + + + + + 团队排序 + - - {{item.childCount ? item.childCount : 0}} - {{item.orderCount ? item.orderCount : 0}} - {{item.numberCount ? item.numberCount : 0}} + 团队排序 + + + 团队排序 + + + + 金额排序 + + + 金额排序 + + + 金额排序 + + + 订单排序 + + + 订单排序 + + + 订单排序 + - + + + + + + + + {{item.nickname}} + 加入时间: {{item.time.split(' ')[0]}} + + + + {{item.childCount ? item.childCount : 0}}人 + + {{item.orderCount ? item.orderCount : 0}} + {{item.numberCount ? item.numberCount : 0}} + + + + + + + + - + @@ -77,7 +87,8 @@ diff --git a/pages/users/user_address_list/index.vue b/pages/users/user_address_list/index.vue index e7753d25..2b78887a 100644 --- a/pages/users/user_address_list/index.vue +++ b/pages/users/user_address_list/index.vue @@ -1,11 +1,11 @@ @@ -117,8 +117,7 @@ import { extractCash, extractBank, - getUserInfo, - brokerageCommission + extractUser } from '@/api/user.js'; import { toLogin @@ -169,8 +168,8 @@ isLogin:{ handler:function(newV,oldV){ if(newV){ - this.getUserInfo(); this.getUserExtractBank(); + this.getExtractUser(); } }, deep:true @@ -178,17 +177,10 @@ }, onLoad() { if (this.isLogin) { - this.getUserInfo(); this.getUserExtractBank(); - //this.getBrokerageCommission(); + this.getExtractUser(); } else { - // #ifdef H5 || APP-PLUS toLogin(); - // #endif - // #ifdef MP - this.isAuto = true; - this.$set(this, 'isShowAuth', true); - // #endif } }, methods: { @@ -218,13 +210,12 @@ this.qrcodeUrlZ = ""; }, onLoadFun: function() { - this.getUserInfo(); this.getUserExtractBank(); - // this.getBrokerageCommission(); }, - getBrokerageCommission: function(){ - brokerageCommission().then(res=>{ + getExtractUser(){ + extractUser().then(res=>{ this.commission = res.data; + this.minPrice = res.data.minPrice; }) }, // 授权关闭 @@ -234,20 +225,9 @@ getUserExtractBank: function() { let that = this; extractBank().then(res => { - let array = res.data.extractBank; + let array = res.data; array.unshift("请选择银行"); that.$set(that, 'array', array); - that.minPrice = res.data.minPrice; - that.commission = res.data; - }); - }, - /** - * 获取个人用户信息 - */ - getUserInfo: function() { - let that = this; - getUserInfo().then(res => { - that.userInfo = res.data; }); }, swichNav: function(current) { @@ -256,6 +236,15 @@ bindPickerChange: function(e) { this.index = e.detail.value; }, + moneyInput(e) { + //正则表达试 + e.target.value = (e.target.value.match(/^\d*(\.?\d{0,2})/g)[0]) || null + //重新赋值给input + this.$nextTick(() => { + this.money= e.target.value + }) + + }, subCash: function(e) { let that = this, value = e.detail.value; @@ -289,13 +278,15 @@ if (value.money.length == 0) return this.$util.Tips({ title: '请填写提现金额' }); + if (!(/^(\d?)+(\.\d{0,2})?$/.test(value.money))) return this.$util.Tips({ + title: '提现金额保留2位小数' + }); if (value.money < that.minPrice) return this.$util.Tips({ title: '提现金额不能低于' + that.minPrice }); if(this.isCommitted==false){ this.isCommitted=true; extractCash(value).then(res => { - that.getUserInfo(); return this.$util.Tips({ title: "提现成功", icon: 'success' @@ -337,7 +328,7 @@ width: 40rpx; height: 40rpx; border-radius: 50%; - border: 2rpx solid #e93323; + border: 2rpx solid $theme-color; text-align: center; line-height: 37rpx; margin: 0 auto 6rpx auto; @@ -346,9 +337,9 @@ } .cash-withdrawal .nav .item .iconfont.on { - background-color: #e93323; + background-color: $theme-color; color: #fff; - border-color: #e93323; + border-color: $theme-color; } .cash-withdrawal .nav .item .line { diff --git a/pages/users/user_coupon/index.vue b/pages/users/user_coupon/index.vue index 776c8a4a..662e4368 100644 --- a/pages/users/user_coupon/index.vue +++ b/pages/users/user_coupon/index.vue @@ -1,5 +1,9 @@