diff --git a/.cursor/rules/md.mdc b/.cursor/rules/md.mdc index 2372112..638864b 100644 --- a/.cursor/rules/md.mdc +++ b/.cursor/rules/md.mdc @@ -1,7 +1,7 @@ --- description: globs: -alwaysApply: false +alwaysApply: true --- 请你写代码之前先查看一下README.md文件,按照这个文件中说的写 diff --git a/api/model/index.js b/api/model/index.js index 3863380..99a6565 100644 --- a/api/model/index.js +++ b/api/model/index.js @@ -113,6 +113,17 @@ const api = { method: 'POST', limit : 1000, }, + // 获取团队信息 + getTeamHeader: { + url: '/info/getTeamHeader', + method: 'GET', + }, + // 取消订单 + cancelOrder: { + url: '/order/cancelOrder', + method: 'POST', + limit : 1000, + }, } export default api \ No newline at end of file diff --git a/components/QuickOrderEntry.vue b/components/QuickOrderEntry.vue new file mode 100644 index 0000000..f9451bd --- /dev/null +++ b/components/QuickOrderEntry.vue @@ -0,0 +1,207 @@ + + + + + \ No newline at end of file diff --git a/components/config/customerServicePopup.vue b/components/config/customerServicePopup.vue index ab978b8..3ddad7a 100644 --- a/components/config/customerServicePopup.vue +++ b/components/config/customerServicePopup.vue @@ -105,7 +105,8 @@ border-radius: 30rpx; } .btn1{ - background-color: #ffb300; + background-color: rgba($color: $uni-color, $alpha: 0.2); + color: $uni-color; } .btn2{ background-color: $uni-color; diff --git a/components/userShop/userShopCommission.vue b/components/userShop/userShopCommission.vue index be66e89..2914463 100644 --- a/components/userShop/userShopCommission.vue +++ b/components/userShop/userShopCommission.vue @@ -6,7 +6,7 @@ 总佣金(元) - 7890.34元 + {{ userInfo.money }}元 @@ -48,6 +48,9 @@ ], }; }, + onLoad() { + this.$store.commit('getUserInfo'); + }, methods : { // 跳转到钱包提现 toPurse(){ diff --git a/config.js b/config.js index 56cbd86..5f98974 100644 --- a/config.js +++ b/config.js @@ -7,7 +7,7 @@ import uvUI from '@/uni_modules/uv-ui-tools' Vue.use(uvUI); // 当前环境 -const type = 'prod' +const type = 'dev' // 环境配置 diff --git a/mixins/order.js b/mixins/order.js index b1650dd..9371ed4 100644 --- a/mixins/order.js +++ b/mixins/order.js @@ -15,12 +15,12 @@ export default { // if([0, 1].includes(item.shopState)){ // api = 'createOrderTwo' // }else{ - api = 'createSumOrderAgain' + api = 'payOrder' // } this.$api(api, { orderId : item.id, - addressId : item.addressId + type : 1, }, res => { if(res.code == 200){ uni.requestPaymentWxPay(res) diff --git a/pages.json b/pages.json index eae8590..10027b8 100644 --- a/pages.json +++ b/pages.json @@ -2,22 +2,24 @@ "pages": [{ "path": "pages/index/index", "style": { - "navigationBarTitleText": "", - "navigationBarTextStyle": "white" + "navigationBarTextStyle": "white", + "enablePullDownRefresh": true } }, { "path": "pages/index/order", "style": { "navigationBarTitleText": "", - "navigationBarTextStyle": "white" + "navigationBarTextStyle": "white", + "enablePullDownRefresh": true } }, { "path": "pages/index/category", "style": { "navigationBarTitleText": "", - "navigationBarTextStyle": "white" + "navigationBarTextStyle": "white", + "enablePullDownRefresh": true } }, { @@ -49,14 +51,23 @@ } }, { - "path": "mine/purse" + "path": "mine/purse", + "style": { + "navigationBarTextStyle": "white" + } }, - { - "path": "mine/runningWater" + "path": "mine/runningWater", + "style": { + "navigationBarTextStyle": "white", + "enablePullDownRefresh": true + } }, { - "path": "mine/address" + "path": "mine/address", + "style": { + "enablePullDownRefresh": true + } }, { "path": "product/productDetail" @@ -96,6 +107,9 @@ }, { "path": "mine/promotion" + }, + { + "path": "mine/about" } ] }], diff --git a/pages/index/center.vue b/pages/index/center.vue index 5a55fa9..080be4b 100644 --- a/pages/index/center.vue +++ b/pages/index/center.vue @@ -5,7 +5,7 @@ - + @@ -34,23 +34,23 @@ - - + + 我的佣金 -

¥{{commission}}

+

¥{{ userInfo.money }}

- + 我的金额 -

¥{{balance}}

+

¥{{ userInfo.price }}

@@ -99,10 +99,10 @@ 邀请好友 - + @@ -110,7 +110,7 @@ + @click="$utils.navigateTo('/pages_order/mine/about')"> 关于本程序 @@ -140,8 +140,6 @@ data() { return { list: [], - commission: 0, // 佣金 - balance: 0, // 余额 isLogin: false, // 登录状态 bannerList : [], } diff --git a/pages/index/index.vue b/pages/index/index.vue index 8bb86e3..f554fdb 100644 --- a/pages/index/index.vue +++ b/pages/index/index.vue @@ -75,17 +75,11 @@ - - - 你有一条新的快捷下单信息 - - - - 1 - - - - +
@@ -94,12 +88,14 @@ @@ -337,58 +349,6 @@ export default { } } -.quick-order-container { - position: fixed; - right: 30rpx; - bottom: 30vh; - z-index: 99; - transition: transform 0.3s; - - &:active { - transform: scale(0.95); - } -} - -.new-message { - position: absolute; - top: 50rpx; - right: 100%; - white-space: nowrap; - background-color: #DC2828; - border-radius: 20rpx; - font-size: 25rpx; - color: $uni-bg-color; - padding: 5rpx 15rpx; - margin-bottom: 10rpx; - box-shadow: 0 5rpx 10rpx rgba(220, 40, 40, 0.3); - animation: pulse 2s infinite; -} - -.quick-order { - position: relative; - width: 230rpx; - height: 160rpx; - - image { - width: 100%; - height: 100%; - - } - - .number-order { - background-color: #DC2828; - position: absolute; - font-size: 30rpx; - height: 40rpx; - width: 40rpx; - text-align: center; - border-radius: 20rpx; - color: #ffffff; - top: 10rpx; - left: 25rpx; - } -} - .shop-list { width: 95%; height: 222rpx; diff --git a/pages/index/order.vue b/pages/index/order.vue index 0c9caa7..0e9b754 100644 --- a/pages/index/order.vue +++ b/pages/index/order.vue @@ -1,239 +1,237 @@ diff --git a/pages_order/auth/wxUserInfo.vue b/pages_order/auth/wxUserInfo.vue index 6bf0721..0db37e1 100644 --- a/pages_order/auth/wxUserInfo.vue +++ b/pages_order/auth/wxUserInfo.vue @@ -32,7 +32,7 @@ v-model="userInfoForm.nickName" />
- +
@@ -76,7 +76,7 @@ }, onShow() {}, onLoad() { - // this.userInfoForm.phone = this.userInfo.phone || '' + this.userInfoForm.phone = this.userInfo.phone || '' this.userInfoForm.nickName = this.userInfo.nickName || '' this.userInfoForm.headImage = this.userInfo.headImage || '' }, @@ -120,7 +120,7 @@ if (self.$utils.verificationAll(self.userInfoForm, { headImage: '请选择头像', nickName: '请填写昵称', - // phone: '请填写手机号', + phone: '请填写手机号', })) { return } @@ -128,7 +128,7 @@ self.$api('updateInfo', { avatarUrl : self.userInfoForm.headImage, nickName : self.userInfoForm.nickName, - // phone : self.userInfoForm.phone, + phone : self.userInfoForm.phone, }, res => { if (res.code == 200) { uni.reLaunch({ diff --git a/pages_order/components/address/addressList.vue b/pages_order/components/address/addressList.vue index 99375b2..89f49b7 100644 --- a/pages_order/components/address/addressList.vue +++ b/pages_order/components/address/addressList.vue @@ -95,7 +95,6 @@ this.addressList = res.result.records || []; this.total = res.result.total || 0; res.result.records.forEach(n => { //筛选默认地址 - console.log(n); if (n.defaultFlag == 1) { this.selectAddress = n.id } diff --git a/pages_order/components/address/redactAddress.vue b/pages_order/components/address/redactAddress.vue index 9e82505..7befe00 100644 --- a/pages_order/components/address/redactAddress.vue +++ b/pages_order/components/address/redactAddress.vue @@ -71,13 +71,13 @@ this.$emit('saveOrUpdate', this.addressDetail) }, //验证用户参数合法性 - parameterVerification(addressDetaila) { + parameterVerification(addressForm) { let { name, phone, address, addressDetails - } = addressDetaila + } = addressForm if (name.trim() == '') { return { title: '请填写联系人', @@ -114,11 +114,11 @@ //地图上选择地址 selectAddr() { - Position.getLocation(res => { - Position.selectAddress(res.longitude, res.latitude, success => { + // Position.getLocation(res => { + Position.selectAddress(0, 0, success => { this.setAddress(success) }) - }) + // }) }, //提取用户选择的地址信息复制给表单数据 @@ -175,6 +175,11 @@ .uv-form { padding: 30rpx 0rpx; } + + .uv-input__content__field-wrapper__field{ + padding: 30rpx !important; + height: 180rpx !important; + } &::v-deep .uv-cell { padding: 0rpx 0rpx; @@ -188,7 +193,6 @@ display: flex; align-items: center; height: 80rpx; - } .uv-field__control, diff --git a/pages_order/components/address/redactAddressForm.vue b/pages_order/components/address/redactAddressForm.vue new file mode 100644 index 0000000..18af7e2 --- /dev/null +++ b/pages_order/components/address/redactAddressForm.vue @@ -0,0 +1,227 @@ + + + + + \ No newline at end of file diff --git a/pages_order/mine/about.vue b/pages_order/mine/about.vue new file mode 100644 index 0000000..3cb3433 --- /dev/null +++ b/pages_order/mine/about.vue @@ -0,0 +1,36 @@ + + + + + diff --git a/pages_order/mine/address.vue b/pages_order/mine/address.vue index f2fa1f9..8bb9c95 100644 --- a/pages_order/mine/address.vue +++ b/pages_order/mine/address.vue @@ -62,6 +62,7 @@ //获取地址详情 editAddress(address) { + this.title = '编辑地址' this.$refs.addressPopup.open({...address}) }, @@ -78,7 +79,7 @@ phone: addressDetail.phone, address: addressDetail.address, addressDetails: addressDetail.addressDetails, - defaultId: addressDetail.defaultId || '0', + defaultFlag: addressDetail.defaultFlag || '0', latitude: addressDetail.latitude, longitude: addressDetail.longitude } @@ -152,7 +153,7 @@ phone: '', address: '', addressDetails: '', - defaultId: '', + defaultFlag: '', latitude: '', longitude: '' }) diff --git a/pages_order/mine/individualTeam.vue b/pages_order/mine/individualTeam.vue index b6988fb..662ff21 100644 --- a/pages_order/mine/individualTeam.vue +++ b/pages_order/mine/individualTeam.vue @@ -11,12 +11,12 @@ - + - 13845131854 - 一级业务员 + {{ userInfo.phone }} + {{ ['一', '二'][info.role] }}级业务员 @@ -26,7 +26,7 @@ 66666 + class="money">{{ info.money }} @@ -43,19 +43,21 @@ lineHeight="8rpx" lineWidth="50rpx" @click="clickTabs"> - + - + - 用户138xxxxxxxx + {{ item.nickName }}{{ item.phone ? item.phone.replace(/(\d{3})\d{4}(\d{4})/, '$1****$2') : '' }} - 下单量:12单 | 佣金: 120元 + 下单量:{{item.orderNum}}单 | 佣金: {{item.commission}} - 已加入平台120天 + 加入{{ $dayjs().diff($dayjs(item.createTime), 'day') }} @@ -79,8 +81,14 @@ name: '间推用户' }, ], + info : {}, }; }, + onLoad() { + this.queryParams.state = 0; + this.$store.commit('getUserInfo'); + this.getTeamInfo(); + }, methods: { //点击tab栏 clickTabs(index) { @@ -98,6 +106,14 @@ url: '/pages_order/mine/purse' }) }, + // 获取团队信息 + getTeamInfo() { + this.$api('getTeamHeader', res => { + if (res.code == 200) { + this.info = res.result; + } + }) + }, }, } @@ -129,6 +145,10 @@ position: absolute; top: 25rpx; left: 26rpx; + image{ + width: 100%; + height: 100%; + } } .number-team { @@ -254,6 +274,10 @@ overflow: hidden; border-radius: 50%; margin-right: 15rpx; + image{ + width: 100%; + height: 100%; + } } .info { diff --git a/pages_order/mine/purse.vue b/pages_order/mine/purse.vue index fe7dd19..5d0ae0f 100644 --- a/pages_order/mine/purse.vue +++ b/pages_order/mine/purse.vue @@ -1,6 +1,9 @@ diff --git a/pages_order/order/orderDetail.vue b/pages_order/order/orderDetail.vue index 837245d..83969ef 100644 --- a/pages_order/order/orderDetail.vue +++ b/pages_order/order/orderDetail.vue @@ -1,105 +1,102 @@ diff --git a/pages_order/order/voiceOrder.vue b/pages_order/order/voiceOrder.vue index 0a059a0..aa2b542 100644 --- a/pages_order/order/voiceOrder.vue +++ b/pages_order/order/voiceOrder.vue @@ -65,7 +65,7 @@ audioPath: '', // 录音文件路径 audioName: '录音文件01.mp3', // 录音文件名称 audioSize: '0KB', // 录音文件大小 - uploadProgress: 100, // 上传进度 + uploadProgress: 0, // 上传进度 recordStartTime: 0, // 录音开始时间 recordTimeout: null, // 录音超时计时器 recordMaxDuration: 60000, // 最大录音时长(毫秒) @@ -363,9 +363,9 @@ } // 显示加载提示 - // uni.showLoading({ - // title: '语音识别中...' - // }); + uni.showLoading({ + title: '上传中...' + }); this.isUploading = true; this.uploadProgress = 0; @@ -410,23 +410,25 @@ // 创建语音订单 createVoiceOrder(audioUrl) { - this.$api('addOrder', { + this.$api('index.addOrder', { voiceUrl: audioUrl, - type: '1', //1表示语音下单 + type: '2', // 2表示语音下单 + userId: uni.getStorageSync('userId') || '' }, res => { uni.hideLoading(); this.isUploading = false; - if (res.code === 0) { + if (res.code === 200) { // 下单成功 uni.showToast({ title: '下单成功', icon: 'success', duration: 1500, success: () => { - uni.reLaunch({ - url: '/pages/index/index' - }) + setTimeout(() => { + // 跳转到订单列表页 + this.$utils.redirectTo('/pages_order/order/orderList'); + }, 1500); } }); } else { diff --git a/pages_order/static/address/icon.png b/pages_order/static/address/icon.png index 6395501..ca890cd 100644 Binary files a/pages_order/static/address/icon.png and b/pages_order/static/address/icon.png differ diff --git a/static/image/center/10.png b/static/image/center/10.png index 151633f..bf9635e 100644 Binary files a/static/image/center/10.png and b/static/image/center/10.png differ diff --git a/static/image/center/headImage.png b/static/image/center/headImage.png deleted file mode 100644 index ac0aa04..0000000 Binary files a/static/image/center/headImage.png and /dev/null differ diff --git a/utils/index.js b/utils/index.js index b40f098..490c426 100644 --- a/utils/index.js +++ b/utils/index.js @@ -27,4 +27,31 @@ Vue.prototype.$dayjs = dayjs Vue.prototype.$timeUtils = time Vue.prototype.$utils = util -Vue.prototype.$md5 = md5 \ No newline at end of file +Vue.prototype.$md5 = md5 + + +// 封装微信支付 +uni.requestPaymentWxPay = function(res){ + return new Promise((success, error) => { + uni.requestPayment({ + provider: 'wxpay', // 服务提提供商 + timeStamp: res.result.timeStamp, // 时间戳 + nonceStr: res.result.nonceStr, // 随机字符串 + package: res.result.packageValue, + signType: res.result.signType, // 签名算法 + paySign: res.result.paySign, // 签名 + success: function (res) { + console.log('支付成功',res); + success(res) + }, + fail: function (err) { + console.log('支付失败',err); + error(err) + uni.showToast({ + icon:'none', + title:"支付失败" + }) + } + }); + }) +} \ No newline at end of file