xiebaomin преди 1 година
родител
ревизия
aad021669e
променени са 33 файла, в които са добавени 435 реда и са изтрити 136 реда
  1. 1 1
      .env.development
  2. 2 1
      .env.production
  3. 25 13
      src/api/institutionApi/login.js
  4. 10 0
      src/api/institutionApi/order.js
  5. 3 3
      src/components/goods-radio.vue
  6. 189 0
      src/components/order-confirm.vue
  7. 5 1
      src/components/order-list-card.vue
  8. 1 2
      src/components/order-report-card.vue
  9. 1 1
      src/components/poster.vue
  10. 1 1
      src/components/store-card.vue
  11. 13 5
      src/permission.js
  12. 1 1
      src/plugin/jsSdk.js
  13. 5 10
      src/store/institution.js
  14. 5 5
      src/views/goods-information/components/infoCell.vue
  15. 1 1
      src/views/goods-information/detail.vue
  16. 1 1
      src/views/ins-intention-report/add.vue
  17. 10 6
      src/views/ins-intention-report/detail.vue
  18. 2 2
      src/views/ins-intention-report/index.vue
  19. 9 4
      src/views/ins-intention-report/intention-confirm.vue
  20. 4 3
      src/views/mine/index.vue
  21. 4 4
      src/views/order-list/components/freight-cell.vue
  22. 31 14
      src/views/order-list/components/order-btn-type.vue
  23. 8 2
      src/views/order-list/components/payment-records.vue
  24. 13 8
      src/views/order-list/index.vue
  25. 1 1
      src/views/order-list/order-create.vue
  26. 25 14
      src/views/order-list/order-detail.vue
  27. 4 4
      src/views/order-report/detail.vue
  28. 1 1
      src/views/pay/mixins/pay.js
  29. 3 3
      src/views/pay/wechatPay.vue
  30. 1 1
      src/views/share/index.vue
  31. 13 1
      src/views/shopping-mall/components/goods-sku.vue
  32. 36 16
      src/views/shopping-mall/detail.vue
  33. 6 6
      src/views/shopping-mall/index.vue

+ 1 - 1
.env.development

@@ -1,6 +1,6 @@
 # 文件标记
 NODE_ENV = 'development'
-BASE_URL = 'https://sell-b.caimei365.com/'
+VUE_APP_DATA_API = 'https://sell-b.caimei365.com/'
 
 # 接口api地址
 #VUE_APP_URL = 'http://192.168.2.103:18002'

+ 2 - 1
.env.production

@@ -2,7 +2,8 @@
 NODE_ENV = 'production'
 
 # 网站地址
-BASE_URL = 'https://sell-b.caimei365.com/'
+VUE_APP_DATA_API = 'https://sell.caimei365.com/'
+
 
 # 接口api地址
 #VUE_APP_URL = 'http://192.168.2.103:18002'

+ 25 - 13
src/api/institutionApi/login.js

@@ -1,13 +1,25 @@
-import http from '@/util/http'
-
-export const login = (data) => http({
-  url: '/login',
-  method: 'POST',
-  data
-})
-
-export const getUserInfo = (params) => http({
-  url: '/userinfo',
-  method: 'GET',
-  params
-})
+import http from '@/util/http'
+
+export const login = (data) => http({
+  url: '/login',
+  method: 'POST',
+  data
+})
+
+export const getUserInfo = (params) => http({
+  url: '/userinfo',
+  method: 'GET',
+  params
+})
+
+export const getOrderMobile = (params) => http({
+  url: '/user/getByDistributionClubMobile',
+  method: 'GET',
+  params
+})
+
+export const orderConfirmFormat = (params) => http({
+  url: '/user/login/organizeDistributionClub',
+  method: 'POST',
+  params
+})

+ 10 - 0
src/api/institutionApi/order.js

@@ -107,3 +107,13 @@ export const orderLogistics = (params) => http({
     isToken: true
   }
 })
+
+// 机构取消订单
+export const orderInsCancel = (data) => http({
+  url: '/order/club/distribution/cancel',
+  method: 'POST',
+  data,
+  headers: {
+    isToken: true
+  }
+})

+ 3 - 3
src/components/goods-radio.vue

@@ -58,9 +58,9 @@ export default {
   border-radius: 50%;
   background: #FF5B00;
   position: absolute;
-  left: 0;
-  top: 0;
-  transform: translate(50%, 50%);
+  left: 50%;
+  top: 50%;
+  transform: translate(-50%, -50%);
 }
 ::v-deep .van-image {
   width: 100%;

+ 189 - 0
src/components/order-confirm.vue

@@ -0,0 +1,189 @@
+<template>
+  <div class="filed">
+    <van-field
+      placeholder="请输入短信验证码"
+      :rules="[{ validator: validatorVerification, message: '请输入6位数验证码' }]"
+      type="digit"
+      :left-icon="!leftIcon ? 'https://static.caimei365.com/app/mini-distribution/email.png' : ''"
+      maxlength="6"
+      v-model="code"
+      @input="$emit('handlerCode', code)"
+    >
+      <template #button>
+        <van-button
+          size="small"
+          type="primary"
+          color="#FF5B00"
+          @click.stop="fetchVerification"
+          :disabled="showTime"
+          >{{ showTime ? `${count} S` : '获取验证码' }}</van-button
+        >
+      </template>
+    </van-field>
+    <van-dialog v-model="showImageCode" title="获取验证码">
+      <van-form @submit="submitCode">
+        <van-field
+          v-model="imgCode"
+          class="img-code"
+          placeholder="请输入图片验证码"
+          :rules="[{ validator: validatorImgCode }]"
+          maxlength="4"
+        />
+        <div class="img-refresh">
+          <van-image :src="dataImage.baseImage"></van-image>
+          <div class="refresh" @click="fetchVerification">刷新</div>
+        </div>
+        <van-button
+          class="get-code"
+          color="#ff5b00"
+          native-type="submit"
+          >获取验证码</van-button
+        >
+      </van-form>
+    </van-dialog>
+  </div>
+</template>
+
+<script>
+import { Toast } from 'vant'
+import {
+  getImageCode,
+  getSmsCode
+} from '@/api/userApi/login.js'
+export default {
+  props: {
+    mobile: {
+      type: String,
+      default: () => ''
+    },
+    leftIcon: {
+      type: Boolean,
+      default: () => true
+    },
+    type: {
+      type: Number,
+      default: () => 14
+    }
+  },
+  data () {
+    return {
+      code: '',
+      showImageCode: false,
+      imgCode: '',
+      dataImage: {},
+      showTime: false,
+      time: null,
+      count: 60
+    }
+  },
+  methods: {
+    validatorVerification (val) {
+      if (this.mobile && this.code) {
+        return /\d{6}/.test(val)
+      }
+    },
+    fetchVerification () {
+      this.showImageCode = true
+      getImageCode({ platformType: 1 }).then((data) => {
+        this.dataImage = data
+        setTimeout(() => {
+          Toast.clear()
+        }, 1000)
+      }).catch(e => {
+        console.log(e)
+      })
+    },
+    validatorImgCode (val) {
+      if (!val) return false
+      else if (this.errMsg) return this.errMsg
+    },
+    handlerCodeTime () {
+      this.showTime = true
+      this.time = setInterval(() => {
+        this.count--
+        if (this.count <= 0) {
+          clearInterval(this.time)
+          this.showTime = false
+          this.count = 60
+          this.imgCode = ''
+        }
+      }, 1000)
+    },
+    submitCode () {
+      getSmsCode({
+        mobile: this.mobile,
+        token: this.dataImage.token,
+        imgCode: this.imgCode,
+        platformType: 1,
+        isCheckCaptcha: 0,
+        activateCodeType: this.type
+      }).then(() => {
+        this.errMsg = ''
+        this.showImageCode = false
+        this.handlerCodeTime()
+      }).catch(() => {
+        this.errMsg = '验证码输入错误'
+        getImageCode({ platformType: 1 }).then((data) => {
+          this.dataImage = data
+        })
+      })
+    }
+  }
+}
+</script>
+
+<style lang="scss" scoped>
+::v-deep .van-dialog__footer {
+  display: none;
+}
+::v-deep .van-dialog__content {
+  padding: 3.5vw 4vw;
+  box-sizing: border-box;
+}
+.filed {
+  position: relative;
+  &::after {
+    position: absolute;
+    box-sizing: border-box;
+    content: ' ';
+    pointer-events: none;
+    right: 16px;
+    bottom: 0;
+    left: 16px;
+    border-bottom: 1px solid #ebedf0;
+    -webkit-transform: scaleY(.5);
+    transform: scaleY(.5);
+}
+}
+.img-refresh {
+  width: 100%;
+  margin: 2.7vw 0;
+  display: flex;
+  align-items: center;
+  justify-content: space-between;
+  .van-image {
+    height: 12vw;
+    width: 50vw;
+    object-fit: cover;
+  }
+  .refresh {
+    width: 20vw;
+    line-height: 12vw;
+    text-align: center;
+    font-size: 3.4vw;
+    color: #ccc;
+  }
+}
+.get-code {
+  width: 100% !important;
+  height: 10vw !important;
+}
+.img-code {
+  border: 1px solid #ccc;
+}
+::v-deep .van-form {
+  .van-button {
+    margin-left: 0vw !important;
+  }
+}
+</style>

+ 5 - 1
src/components/order-list-card.vue

@@ -2,7 +2,7 @@
   <div class="order-list-card">
     <slot name="order-head"></slot>
     <div class="order">
-      <order-goods-info :productInfo="productInfo" :goodInfo="productInfo" :status="status" @click.native="$emit('handlerOrder', [productInfo, userId])" />
+      <order-goods-info :productInfo="productInfo" :goodInfo="productInfo" :status="status" :showStatus="showStatus" @click.native="$emit('handlerOrder', [productInfo, userId])" />
       <div class="order-foot">
         <div class="order-all-goods">共{{ productInfo.num }}件商品</div>
         <div class="order-all-price">待付总金额:<span class="price">¥{{ productInfo.totalAmount.toFixed(2) }}</span></div>
@@ -26,6 +26,10 @@ export default {
     userId: {
       type: Number,
       default: () => 0
+    },
+    showStatus: {
+      type: Boolean,
+      default: () => true
     }
   }
 }

+ 1 - 2
src/components/order-report-card.vue

@@ -49,7 +49,7 @@ export default {
   },
   computed: {
     statusImage () {
-      return this.odRpCd.orderstatus * 1 === 1
+      return this.odRpCd.orderStatus * 1 === 1
         ? 'https://static.caimei365.com/app/mini-distribution/order-success.png'
         : ''
     }
@@ -132,7 +132,6 @@ export default {
     position: absolute;
     width: 21.3vw;
     height: 21.3vw;
-    border: 1px solid;
   }
 }
 </style>

+ 1 - 1
src/components/poster.vue

@@ -129,7 +129,7 @@ export default {
       return this.$route.query.cId
     },
     codeText () {
-      return `http://sell-b.caimei365.com/goods-detail?productId=${this.productId}&typeId=0&suid=${this.$store.getters.userId}&isIns=1`
+      return `${process.env.VUE_APP_DATA_API}goods-detail?productId=${this.productId}&typeId=0&suid=${this.$store.getters.userId}&isIns=1`
     }
   },
   watch: {

+ 1 - 1
src/components/store-card.vue

@@ -2,7 +2,7 @@
   <div class="card" @click="$emit('handlerClick', storeInfo)">
     <van-image width="100%" :src="storeInfo.mainImage" />
     <div class="store-title">{{ storeInfo.name }}</div>
-    <div class="store-price">¥{{ storeInfo.price }}</div>
+    <div class="store-price">¥{{ storeInfo.price.toFixed(2) }}</div>
   </div>
 </template>
 

+ 13 - 5
src/permission.js

@@ -2,11 +2,15 @@ import router from './router'
 import NProgress from 'nprogress'
 import store from './store'
 import 'nprogress/nprogress.css'
-import { getToken } from '@/util/auth'
+import {
+  getToken
+} from '@/util/auth'
 
-NProgress.configure({ showSpinner: false })
+NProgress.configure({
+  showSpinner: false
+})
 
-const whiteList = ['/login', '/pwlogin', '/forgotPW', '/goods-detail', '/order-list', '/share', '/order-detail', '/order-pay', '/paymentOnline', '/paymentOffline', '/wechatpay']
+const whiteList = ['/login', '/pwlogin', '/forgotPW', '/goods-detail', '/order-list', '/share', '/order-detail', '/order-pay', '/paymentOnline', '/paymentOffline', '/wechatpay', '/intention-confirm', '/upload-voucher', '/orderLogistics']
 
 router.beforeEach((to, from, next) => {
   NProgress.start()
@@ -16,7 +20,9 @@ router.beforeEach((to, from, next) => {
       document.title = to.meta.title
     }
     if (to.path === '/login' || to.path === '/pwlogin') {
-      next({ path: '/pwlogin' })
+      next({
+        path: '/pwlogin'
+      })
       NProgress.done()
     } else {
       if (!store.getters.userInfo) {
@@ -27,7 +33,9 @@ router.beforeEach((to, from, next) => {
         }).catch(err => {
           console.log(err)
           store.dispatch('user/loginOut').then(() => {
-            next({ path: '/pwlogin' })
+            next({
+              path: '/pwlogin'
+            })
           })
         })
       } else {

+ 1 - 1
src/plugin/jsSdk.js

@@ -17,7 +17,7 @@ Vue.prototype.$wxReady = async (callback, shareUrl) => {
     if (!wx) return
     // const signature = SHA1(`jsapi_ticket=${res.ticket}&noncestr=${nonceStr}&timestamp=${timestamp}&url=${encodeURIComponent(url)}`).toString()
     wx.config({
-      debug: true, // 开启调试模式,调用的所有 api 的返回值会在客户端 alert 出来,若要查看传入的参数,可以在 pc 端打开,参数信息会通过 log 打出,仅在 pc 端时才会打印。
+      debug: true, // dev === 'development' 开启调试模式,调用的所有 api 的返回值会在客户端 alert 出来,若要查看传入的参数,可以在 pc 端打开,参数信息会通过 log 打出,仅在 pc 端时才会打印。
       appId: 'wx91c4152b60ca91a3', // 必填,公众号的唯一标识
       timestamp: res.timestamp, // 必填,生成签名的时间戳
       nonceStr: res.noncestr, // 必填,生成签名的随机串

+ 5 - 10
src/store/institution.js

@@ -1,5 +1,4 @@
 // 机构 store
-import { login } from '@/api/institutionApi/login'
 import { setToken } from '@/util/auth'
 import { addressList } from '@/api/institutionApi/address'
 
@@ -21,16 +20,12 @@ const mutations = {
 }
 
 const actions = {
-  insLogin: ({ commit }, userInfo) => {
+  insLogin: ({ commit }, token) => {
     return new Promise((resolve, reject) => {
-      login(userInfo).then(res => {
-        setToken(res.token)
-        commit('SET_TOKEN', res.token)
-        console.log('登录成功', res)
-        resolve(res)
-      }).catch(err => {
-        reject(err)
-      })
+      setToken(token)
+      commit('SET_TOKEN', token)
+      console.log('token设置成功')
+      resolve(token)
     })
   },
   addressList: ({ commit }) => {

+ 5 - 5
src/views/goods-information/components/infoCell.vue

@@ -81,7 +81,7 @@ export default {
   padding: 0 2.4vw;
   .info-title {
     color: #333333;
-    font-size: 2.8vw;
+    font-size: 3.2vw;
     padding: 4.8vw 0;
     height: 5.6vw;
     font-weight: 600;
@@ -92,11 +92,11 @@ export default {
     .info-content {
       .info-content-title {
         color: #333333;
-        font-size: 2.8vw;
+        font-size: 3.2vw;
         line-height: 4.8vw;
       }
       .info-content-time {
-        font-size: 2.4vw;
+        font-size: 2.8vw;
         color: #B2B2B2;
         margin: 1.6vw 0 3.2vw 0;
       }
@@ -147,7 +147,7 @@ export default {
               height: 8.8vw;
               width: 100%;
               line-height: 4.8vw;
-              font-size: 2.8vw;
+              font-size: 3.2vw;
               color: #333;
               @include webkit-line-clamp(2);
             }
@@ -156,7 +156,7 @@ export default {
               justify-content: space-between;
               span:nth-child(1) {
                 color: #B2B2B2;
-                font-size: 2.4vw;
+                font-size: 2.8vw;
               }
               span:nth-child(2) {
                 color: #FF5B00;

+ 1 - 1
src/views/goods-information/detail.vue

@@ -84,7 +84,7 @@ export default {
 .store-info {
   padding: 4vw 0;
   text-align: center;
-  font-size: 3.6vw;
+  font-size: 4vw;
   color: #333;
   background: #fff;
   font-weight: 600;

+ 1 - 1
src/views/ins-intention-report/add.vue

@@ -118,7 +118,7 @@ export default {
     width: 100%;
     height: 47.2vw;
     font-size: 3.5vw;
-    color: #B2B2B2;
+    color: #333;
     border: 1px solid #B2B2B2;
     padding: 3.2vw 2.1vw;
     box-sizing: border-box;

+ 10 - 6
src/views/ins-intention-report/detail.vue

@@ -93,13 +93,17 @@ export default {
     initAppMessageShareData () {
       this.$wxReady((wx) => {
         // 需在用户可能点击分享按钮前就先调用
-        wx.updateAppMessageShareData({
-          title: '商品详情', // 分享标题
-          desc: '商品详情', // 分享描述
-          link: `https://sell-b.caimei365.com/#/intention-confirm?id=${this.resultInfo.cmReportingClub.id}`, // 分享链接,该链接域名或路径必须与当前页面对应的公众号 JS 安全域名一致
-          imgUrl: 'https://static.caimei365.com/app/mini-distribution/qrcode.png', // 分享图标
+        wx.onMenuShareAppMessage({
+          title: '意向确认', // 分享标题
+          desc: '意向确认', // 分享描述
+          link: `${process.env.VUE_APP_DATA_API}intention-confirm?id=${this.resultInfo.cmReportingClub.id}&userInfo=${JSON.stringify({ img: this.$store.getters.userInfo.image, linkMan: this.$store.getters.userInfo.linkMan })}`, // 分享链接,该链接域名或路径必须与当前页面对应的公众号 JS 安全域名一致
+          imgUrl: `${process.env.VUE_APP_DATA_API}favicon.png`, // 分享图标
+          type: 'link',
+          success: () => {
+            alert('onMenuShareAppMessage: 设置成功')
+          },
           fail: () => {
-            this.initAppMessageShareData()
+            alert('onMenuShareAppMessage: 设置失败')
           }
         })
       })

+ 2 - 2
src/views/ins-intention-report/index.vue

@@ -98,10 +98,10 @@ export default {
       this.getInsIntentionReportList(this.active)
     },
     handlerDetail ($event) {
-      this.$ApiRouter(`/ins-intention-detail/?id=${$event.id}`)
+      this.$ApiRouter(`/ins-intention-detail?id=${$event.id}`)
     },
     handlerPlaceOrder ($event) {
-      this.$router.push(`/goods-detail?productId=${$event.productId}&typeId=0&isLock=1&cId=${$event.id}`)
+      window.location.href = `/goods-detail?productId=${$event.productId}&typeId=0&isLock=1&cId=${$event.id}`
     },
     async getInsIntentionReportList ($event) {
       const j = $event === 0 ? { id: this.$store.getters.userInfo.id } : { parentId: this.$store.getters.userInfo.id }

+ 9 - 4
src/views/ins-intention-report/intention-confirm.vue

@@ -3,11 +3,11 @@
     <!--<nav-bar title="采购意向确认" @click-left="$router.back()" />-->
     <div class="container">
       <div class="user-img">
-        <van-image :src="$store.getters.userInfo.image || 'https://static.caimei365.com/app/mini-distribution/default.png'"></van-image>
+        <van-image :src="userInfo.img || 'https://static.caimei365.com/app/mini-distribution/default.png'"></van-image>
       </div>
-      <div class="name">{{ $store.getters.userInfo.linkMan }}</div>
+      <div class="name">{{ userInfo.linkMan }}</div>
       <div class="pro-name"></div>
-      <div class="tips">您是否愿意接受{{ $store.getters.userInfo.linkMan }}客户经理为您采购以下商品的全程服务?
+      <div class="tips">您是否愿意接受{{ userInfo.linkMan }}客户经理为您采购以下商品的全程服务?
         如您愿意,可点击接受,后续将由该客户经理全程为您服务!</div>
       <div class="goods-detail" v-if="resultInfo.cmReportingClub">
         <van-image :src="resultInfo.cmReportingClub.distributionProduct.mainImage" />
@@ -31,10 +31,14 @@ export default {
   computed: {
     id () {
       return this.$route.query.id
+    },
+    userInfo () {
+      return JSON.parse(this.$route.query.userInfo)
     }
   },
   mounted () {
     this.insIntentionReportDetail()
+    console.log(this.userInfo)
   },
   methods: {
     async insIntentionReportDetail () {
@@ -99,7 +103,7 @@ export default {
     box-sizing: border-box;
     margin: 5.8vw 0 11.5vw 0;
     ::v-deep .van-image{
-      width: 18.4vw;
+      width: 24.4vw;
       height: 18.4vw;
       border-radius: 0.6vw;
       margin-right: 3.5vw;
@@ -109,6 +113,7 @@ export default {
       line-height: 6vw;
       font-size: 4vw;
       font-weight: 600;
+      width: 80vw;
     }
   }
   ::v-deep .van-button {

+ 4 - 3
src/views/mine/index.vue

@@ -229,8 +229,8 @@ export default {
     margin-top: 10vw;
     white-space: nowrap;
     img {
-      width: 9.3vw;
-      height: 9.1vw;
+      width: 10vw;
+      height: 10vw;
       position: relative;
       &::before {
         content: '';
@@ -255,7 +255,8 @@ export default {
     }
     div {
       color: #999999;
-      font-size: 3vw;
+      font-size: 2.6vw;
+      margin-top: 2vw;
     }
   }
 }

+ 4 - 4
src/views/order-list/components/freight-cell.vue

@@ -128,13 +128,13 @@ export default {
       border-color: #FF5B00;
       &::before {
         content: '';
-        display: absolute;
-        left: 0;
-        top: 0;
+        position: absolute;
+        left: 50%;
+        top: 50%;
         background: #FF5B00;
         width: 2vw;
         height: 2vw;
-        transform: translate(5%, -40%);
+        transform: translate(-50%, -40%);
         border-radius: 50%;
       }
     }

+ 31 - 14
src/views/order-list/components/order-btn-type.vue

@@ -19,8 +19,8 @@
     </van-dialog>
     <van-dialog v-model="showConfirm" title="确认订单" :show-confirm-button="false">
       <div class="contentConfirm">
-        <van-field v-model="formData.mobile" placeholder="请输入手机号" label="下单手机号:" maxlength="11" type="digit"/>
-        <field-image-code :mobile="formData.mobile" :leftIcon="true" @handlerCode="handlerCode"/>
+        <van-field :value="formData.mobile.substr(0, 3) + '****' + formData.mobile.substr(8, 11)" disabled label="下单手机号:"/>
+        <order-confirm :mobile="formData.mobile" :leftIcon="true" @handlerCode="handlerCode" :type="14"/>
         <div class="tips">提示:为了给确保订单信息的安全性,将使用您下单
           时的手机号进行短信验证,首次确认下单将默认给您
           注册买家账号,便于您登录商城查看订单情况。</div>
@@ -35,6 +35,7 @@
 <script>
 import orderIndex from '../mixins/order-index'
 import { confirmOrder, cancelOrder, shareOrderCode } from '@/api/institutionApi/order'
+import { getOrderMobile, orderConfirmFormat } from '@/api/institutionApi/login'
 import { Toast } from 'vant'
 export default {
   mixins: [orderIndex],
@@ -111,11 +112,11 @@ export default {
         ]
       } else {
         return [
-          {
-            id: 0,
-            name: '确认订单',
-            label: 'isConfirm'
-          },
+          // {
+          //  id: 0,
+          //  name: '确认订单',
+          //  label: 'isConfirm'
+          // },
           {
             id: 1,
             name: '取消订单',
@@ -143,10 +144,8 @@ export default {
   watch: {
     formData: {
       handler (val) {
-        console.log(val)
         if (val.mobile && val.code) {
           if (this.formData.code.length < 6) {
-            Toast.fail('验证码输入错误')
             this.disabled = true
             return
           }
@@ -185,7 +184,6 @@ export default {
       return this.productInfo.checkFlag * 1 === 2
     },
     async orderCancel () {
-      console.log('取消订单')
       try {
         await cancelOrder({ shopOrderId: this.productInfo.shopOrderId, userIdentity: 1 })
         this.$emit('orderCancel')
@@ -206,17 +204,29 @@ export default {
       }
       // this.$emit('orderPay')
     },
-    confirm () {
+    async confirm () {
       if (this.isIns) {
-        this.showConfirm = true
+        try {
+          const data = await getOrderMobile({ userId: this.productInfo.userId })
+          this.formData.mobile = data
+          this.showConfirm = true
+        } catch (e) {
+          Toast.fail('手机号获取失败')
+          console.log(e)
+        }
       } else {
         this.orderConfirm()
       }
     },
     async orderConfirm () {
       try {
-        await confirmOrder({ shopOrderId: this.productInfo.shopOrderId })
-        this.$emit('orderConfirm')
+        const data = await orderConfirmFormat(Object.assign(this.formData, { userId: this.productInfo.userId }))
+        console.log(data)
+        this.$store.dispatch('institution/insLogin', data).then(() => {
+          confirmOrder({ shopOrderId: this.productInfo.shopOrderId }).then(() => {
+            this.$emit('orderConfirm')
+          })
+        })
         this.showConfirm = false
       } catch (error) {
         console.log(error)
@@ -286,4 +296,11 @@ export default {
     font-size: 4.3vw;
   }
 }
+::v-deep .van-field--disabled .van-field__label {
+  color: #333;
+}
+::v-deep .van-field__control:disabled {
+  color: #333;
+  -webkit-text-fill-color: #333;
+}
 </style>

+ 8 - 2
src/views/order-list/components/payment-records.vue

@@ -1,6 +1,6 @@
 <template>
   <div class="records">
-    <van-cell title="支付记录" value="" :is-link="!disabled"/>
+    <van-cell title="支付记录" :value="'已支付:¥' + value" :is-link="!disabled"/>
     <slot name="content"></slot>
   </div>
 </template>
@@ -11,11 +11,17 @@ export default {
     disabled: {
       type: Boolean,
       default: () => false
+    },
+    value: {
+      type: Number,
+      default: () => 0
     }
   }
 }
 </script>
 
 <style lang="scss" scoped>
-
+.van-cell__value {
+  color: red;
+}
 </style>

+ 13 - 8
src/views/order-list/index.vue

@@ -23,6 +23,7 @@
         :status="item.status"
         :userId="item.userId"
         :productInfo="item.orderProductList[0]"
+        :showStatus="isIns ? false : true"
       >
         <template #order-head>
           <div class="order-place" v-if="isIns && activeBtn === 2">
@@ -187,8 +188,12 @@ export default {
       this.handlerManage(this.activeBtn)
     },
     orderCancel () {
+      if (this.isIns) {
+        this.orderInsList()
+      } else {
+        this.handlerManage(this.activeBtn)
+      }
       console.log('取消订单')
-      this.handlerManage(this.activeBtn)
     },
     orderQuery () {
       console.log('查看物流')
@@ -197,7 +202,7 @@ export default {
       console.log('支付订单')
     },
     orderConfirm () {
-      this.handlerManage(this.activeBtn)
+      this.orderInsList()
     },
     // 分享当前页面
     initAppMessageShareData (info) {
@@ -207,7 +212,7 @@ export default {
         //  title: '分享订单', // 分享标题
         //  desc: '分享订单', // 分享描述
         //  link: `https://sell-b.caimei365.com/share?type=2&shopOrderId=${info.shopOrderId}&userId=${info.userId}`, // 分享链接,该链接域名或路径必须与当前页面对应的公众号 JS 安全域名一致
-        //  imgUrl: 'https://static.caimei365.com/app/mini-distribution/qrcode.png', // 分享图标
+        //  imgUrl: `${process.env.VUE_APP_DATA_API}favicon.png`, // 分享图标
         //  fail: () => {
         //    alert('updateAppMessageShareData: 设置错误')
         //  },
@@ -216,10 +221,10 @@ export default {
         //  }
         // })
         wx.onMenuShareAppMessage({
-          title: `http://sell-b.caimei365.com/share?type=2&shopOrderId=${info.shopOrderId}&userId=${info.userId}`, // 分享标题
-          desc: `http://sell-b.caimei365.com/share?type=2&shopOrderId=${info.shopOrderId}&userId=${info.userId}`, // 分享描述
-          link: `http://sell-b.caimei365.com/share?type=2&shopOrderId=${info.shopOrderId}&userId=${info.userId}&active=0`, // 分享链接,该链接域名或路径必须与当前页面对应的公众号 JS 安全域名一致
-          imgUrl: 'http://sell-b.caimei365.com/favicon.png', // 分享图标
+          title: `${process.env.VUE_APP_DATA_API}share?type=2&shopOrderId=${info.shopOrderId}&userId=${info.userId}`, // 分享标题
+          desc: `${process.env.VUE_APP_DATA_API}share?type=2&shopOrderId=${info.shopOrderId}&userId=${info.userId}`, // 分享描述
+          link: `${process.env.VUE_APP_DATA_API}share?type=2&shopOrderId=${info.shopOrderId}&userId=${info.userId}&active=0`, // 分享链接,该链接域名或路径必须与当前页面对应的公众号 JS 安全域名一致
+          imgUrl: `${process.env.VUE_APP_DATA_API}favicon.png`, // 分享图标
           type: 'link',
           success: () => {
             alert('onMenuShareAppMessage: 设置成功')
@@ -321,7 +326,7 @@ export default {
     width: 21.3vw;
     height: 8.5vw;
     border-radius: 1.1vw;
-    margin-left: 3.2vw;
+    margin-left: 2vw;
     font-size: 3.5vw;
     white-space: nowrap;
     margin-bottom: 2vw;

+ 1 - 1
src/views/order-list/order-create.vue

@@ -161,7 +161,7 @@ export default {
           payInfo: JSON.stringify(this.payInfo)
         })
       ).then((res) => {
-        this.$router.push(`/order-pay?orderId=${res.orderId}`)
+        this.$router.push('/order-list')
       })
     },
     handlerInvoice ($event) {

+ 25 - 14
src/views/order-list/order-detail.vue

@@ -59,22 +59,20 @@
         <div class="content" v-else>暂无发票信息</div>
       </template>
     </invoice-information>
-    <payment-records :disabled="true">
+    <payment-records v-if="receiptAmount > 0" :disabled="true" :value="orderInfo.receiptAmount | NumFormat">
       <template #content>
         <div class="content" v-if="discernReceiptList && discernReceiptList.length > 0">
-          <div class="record-title-r">
-            已支付:<span class="red">¥{{record.associateAmount | NumFormat}}</span>
+          <div>
+            <div class="record-item" v-for="(record,index) in discernReceiptList" :key="index">
+              <div class="item-time mm"><span>{{ record.payTypeStr }}</span>¥{{ record.associateAmount | NumFormat }}</div>
+              <div class="item-time tt">{{ record.receiptDate }}</div>
+            </div>
           </div>
-          <div class="record-item" v-for="(record,index) in discernReceiptList" :key="index">
-            <div class="item-time mm"></div>
-            <div class="item-time pp">{{record | payTypeText}}</div>
-            <div class="item-time tt">{{record.receiptDate}}</div>
-        </div>
         </div>
         <div class="content" v-else>暂无支付记录</div>
       </template>
     </payment-records>
-    <payment-voucher :disabled="true">
+    <payment-voucher :disabled="true" v-if="voucherList.length > 0">
       <template #content>
         <div class="content" v-if="voucherList && voucherList.length > 0">
           <div v-for="voucher in voucherList" :key="voucher.id">
@@ -178,7 +176,7 @@ export default {
       return this.$route.query.shopOrderId
     },
     isIns () {
-      return this.$route.query.isIns
+      return this.$route.query.isIns * 1
     },
     userId () {
       return this.$route.query.userId
@@ -220,13 +218,17 @@ export default {
     initAppMessageShareData (info) {
       this.$wxReady((wx) => {
         // 需在用户可能点击分享按钮前就先调用
-        wx.updateAppMessageShareData({
+        wx.onMenuShareAppMessage({
           title: '分享订单', // 分享标题
           desc: '分享订单', // 分享描述
-          link: `https://sell-b.caimei365.com/#/share?type=1&shopOrderId=${info.shopOrderId}&userId=${info.userId}`, // 分享链接,该链接域名或路径必须与当前页面对应的公众号 JS 安全域名一致
-          imgUrl: 'https://static.caimei365.com/app/mini-distribution/qrcode.png', // 分享图标
+          link: `${process.env.VUE_APP_DATA_API}share?type=2&shopOrderId=${this.shopOrderId}&userId=${this.userId}`, // 分享链接,该链接域名或路径必须与当前页面对应的公众号 JS 安全域名一致
+          imgUrl: `${process.env.VUE_APP_DATA_API}favicon.png`, // 分享图标
+          type: 'link',
+          success: () => {
+            alert('onMenuShareAppMessage: 设置成功')
+          },
           fail: () => {
-            this.initAppMessageShareData(info)
+            alert('onMenuShareAppMessage: 设置失败')
           }
         })
       })
@@ -284,6 +286,15 @@ export default {
   font-size: 14px;
   color: #666;
   background: #fff;
+  .record-item {
+    margin-bottom: 2vw;
+    .item-time {
+      margin-bottom: 2vw;
+    }
+    span {
+      margin-right: 2vw;
+    }
+  }
   .time {
     font-size: 3.5vw;
     color: #666;

+ 4 - 4
src/views/order-report/detail.vue

@@ -38,8 +38,8 @@
               <div>{{ i.createTime }}</div>
             </div>
           </div>
-          <div class="compile">
-            <van-button @click="compile(data)">确认结算</van-button>
+          <div class="compile" v-if="settleStatus === 1">
+            <van-button @click="compile(i)">确认结算</van-button>
           </div>
         </template>
       </order-report-card>
@@ -67,7 +67,7 @@ export default {
       return this.$route.query.id
     },
     settleStatus () {
-      return this.$route.query.settleStatus
+      return this.$route.query.settleStatus * 1
     }
   },
   methods: {
@@ -80,7 +80,7 @@ export default {
       })
     },
     async orderReportDetail () {
-      const data = await orderReportDetail({ id: this.id, settleStatus: this.settleStatus })
+      const data = await orderReportDetail({ id: this.id, settleStatus: this.settleStatus, shopOrderNo: this.formData.shopOrderNo })
       this.form = data.cmDistribution
       this.orderList = data.paginationVo.results
     }

+ 1 - 1
src/views/pay/mixins/pay.js

@@ -16,7 +16,7 @@ export default {
         shopOrderId: this.$route.query.shopOrderId,
         payAmount: this.$route.query.payAmount
       }
-      location.href = `https://open.weixin.qq.com/connect/oauth2/authorize?appid=${appId}&redirect_uri=${encodeURIComponent('http://sell-b.caimei365.com/wechatpay')}&response_type=code&scope=snsapi_base&state=${JSON.stringify(orderInfo)}#wechat_redirect`
+      location.href = `https://open.weixin.qq.com/connect/oauth2/authorize?appid=${appId}&redirect_uri=${encodeURIComponent(`${process.env.VUE_APP_DATA_API}wechatpay`)}&response_type=code&scope=snsapi_base&state=${JSON.stringify(orderInfo)}#wechat_redirect`
     },
     inItPayMent () {
       if (this.isWeChat && this.isShow === 0) {

+ 3 - 3
src/views/pay/wechatPay.vue

@@ -2,7 +2,7 @@
   <div>
     <div class="pay-container  clearfix" id="payContainer" :class="isRequest? 'active' : ''">
       <div class="pay-amount">
-          <div class="icon"><img src="/img/pay/icon-paybg@2x.png" alt=""></div>
+          <div class="icon"><img src="http://sell-b.caimei365.com/favicon.png" alt=""></div>
           <div class="pay-money">
               <div class="label">付款金额</div>
               <div class="mount"><span>¥</span>{{ payAmount }}</div>
@@ -10,7 +10,7 @@
       </div>
       <div class="pay-button"><div class="btn" @click="WxPaySubmit" :class="isSubMitStatus ? 'disabled' : ''">立即支付</div></div>
       <div class="pay-logo">
-          <div class="logo">采美365网</div>
+          <div class="logo">分销团队</div>
       </div>
     </div>
   </div>
@@ -65,7 +65,7 @@ export default {
         code: this.wechatcode,
         state: this.random(1000, 9999),
         shopOrderId: this.shopOrderId,
-        returnUrl: 'https://sell-b.caimei365.com/'
+        returnUrl: 'https://sell.caimei365.com/'
       }
       console.log('=========>普通订单合利宝公众号支付', params)
       try {

+ 1 - 1
src/views/share/index.vue

@@ -53,7 +53,7 @@ export default {
         if (this.type === 1) {
           this.$router.push(`/order-detail?shopOrderId=${query.shopOrderId}&userId=${query.userId}&isIns=1`)
         } else if (this.type === 2) {
-          this.$router.push(`/order-list?&uId=${query.userId}&isIns=1&active=${query.active}`)
+          this.$router.push(`/order-list?uId=${query.userId}&isIns=1&active=${query.active}`)
         }
       } catch (error) {
         console.log(error)

+ 13 - 1
src/views/shopping-mall/components/goods-sku.vue

@@ -9,6 +9,7 @@
       :quota="quota"
       :quota-used="quotaUsed"
       :hide-stock="skus.hide_stock"
+      :initial-sku="initialSku"
     >
     <template #sku-header-price="props">
       <div class="van-sku__goods-price">
@@ -38,7 +39,8 @@ export default {
       show: false,
       quota: 0,
       quotaUsed: 0,
-      selectSkuValue: '请选择规格'
+      selectSkuValue: '请选择规格',
+      initialSku: {}
     }
   },
   computed: {
@@ -86,6 +88,16 @@ export default {
           price: e.price * 100,
           stock_num: e.stock
         }))
+        // eslint-disable-next-line vue/no-side-effects-in-computed-properties
+        this.selectSkuValue = `共${skuList.length}种规格可选`
+        // eslint-disable-next-line vue/no-side-effects-in-computed-properties
+        this.initialSku = {
+          s1: skuList[0].s1,
+          selectedNum: 0,
+          selectedProp: {
+            id: skuList[0].s1
+          }
+        }
         return {
           tree: [
             {

+ 36 - 16
src/views/shopping-mall/detail.vue

@@ -6,7 +6,8 @@
     <goods-sku :productInfo="productInfo" @handlerSku="handlerSku"/>
     <goods-classification :productInfo="productInfo"/>
     <goods-detail :productInfo="productInfo"/>
-    <div class="buy-now" v-if="isLock">
+    <div class="offline" v-if="isgoBy">该商品已下架啦~</div>
+    <div class="buy-now" v-if="isLock && !isgoBy">
       <div class="foot" @click="$router.push('/shopping-mall')">
         <van-image class="index" width="80%" height="80%" src="https://static.caimei365.com/app/mini-distribution/index.png"></van-image>
         <div>首页</div>
@@ -40,7 +41,8 @@ export default {
       skus: {},
       imageList: [],
       userInfo: {},
-      dataInfo: {}
+      dataInfo: {},
+      isgoBy: false
     }
   },
   computed: {
@@ -67,12 +69,16 @@ export default {
   },
   methods: {
     async productDetail () {
-      const data = await productDetail(Object.assign(this.formData, { productId: this.productId, typeId: this.typeId }))
-      this.productInfo = data
-      this.imageList = data.imageList.map(i => i.image)
-      this.skus = data.skus
-      this.dataInfo.productImage = this.imageList[0]
-      this.dataInfo.name = this.productInfo.name
+      try {
+        const data = await productDetail(Object.assign(this.formData, { productId: this.productId, typeId: this.typeId }))
+        this.productInfo = data
+        this.imageList = data.imageList.map(i => i.image)
+        this.skus = data.skus
+        this.dataInfo.productImage = this.imageList[0]
+        this.dataInfo.name = this.productInfo.name
+      } catch (err) {
+        this.isgoBy = true
+      }
     },
     handlerSku ({ selectedNum, selectedSku }) {
       this.$router.push(`/order-create?selectedNum=${selectedNum}&selectedSku=${selectedSku.s1}&typeId=${this.typeId}&productId=${this.productId}&cId=${this.cId}`)
@@ -89,10 +95,10 @@ export default {
       this.$wxReady((wx) => {
         // 需在用户可能点击分享按钮前就先调用
         // wx.updateAppMessageShareData({
-        //  title: `https://sell-b.caimei365.com/goods-detail?productId=${this.productId}&typeId=0&suid=${this.$store.getters.userId}&isIns=1`, // 分享标题
-        //  desc: `http://sell-b.caimei365.com/goods-detail?productId=${this.productId}&typeId=0&suid=${this.$store.getters.userId}&isIns=1`, // 分享描述
-        //  link: `http://sell-b.caimei365.com/goods-detail?productId=${this.productId}&typeId=0&suid=${this.$store.getters.userId}&isIns=1`, // 分享链接,该链接域名或路径必须与当前页面对应的公众号 JS 安全域名一致
-        //  imgUrl: 'https://static.caimei365.com/app/mini-distribution/qrcode.png', // 分享图标
+        //  title: '商品详情', // 分享标题
+        //  desc: `${process.env.VUE_APP_DATA_API}goods-detail?productId=${this.productId}&typeId=0&suid=${this.$store.getters.userId}&isIns=1`, // 分享描述
+        //  link: `${process.env.VUE_APP_DATA_API}goods-detail?productId=${this.productId}&typeId=0&suid=${this.$store.getters.userId}&isIns=1`, // 分享链接,该链接域名或路径必须与当前页面对应的公众号 JS 安全域名一致
+        //  imgUrl: `${process.env.VUE_APP_DATA_API}favicon.png`, // 分享图标
         //  fail: () => {
         //    alert('updateAppMessageShareData: 设置错误')
         //  },
@@ -101,10 +107,10 @@ export default {
         //  }
         // }) // `https://sell-b.caimei365.com/goods-detail?productId=${this.productId}&typeId=0&suid=${this.$store.getters.userId}&isIns=1`
         wx.onMenuShareAppMessage({
-          title: `https://sell-b.caimei365.com/goods-detail?productId=${this.productId}&typeId=0&suid=${this.$store.getters.userId}&isIns=1`, // 分享标题
-          desc: `https://sell-b.caimei365.com/goods-detail?productId=${this.productId}&typeId=0&suid=${this.$store.getters.userId}&isIns=1`, // 分享描述
-          link: `http://sell-b.caimei365.com/goods-detail?productId=${this.productId}&typeId=0&suid=${this.$store.getters.userId}&isIns=1`, // 分享链接,该链接域名或路径必须与当前页面对应的公众号 JS 安全域名一致
-          imgUrl: 'https://static.caimei365.com/app/mini-distribution/qrcode.png', // 分享图标
+          title: '分销商城', // 分享标题
+          desc: '分销商城', // 分享描述
+          link: `${process.env.VUE_APP_DATA_API}goods-detail?productId=${this.productId}&typeId=0&suid=${this.$store.getters.userId}&isIns=1`, // 分享链接,该链接域名或路径必须与当前页面对应的公众号 JS 安全域名一致
+          imgUrl: `${process.env.VUE_APP_DATA_API}favicon.png`, // 分享图标
           type: 'link',
           success: () => {
             alert('onMenuShareAppMessage: 设置成功')
@@ -129,6 +135,20 @@ export default {
 .classification {
   margin-bottom: 2.7vw;
 }
+.offline {
+  width: 100%;
+  display: flex;
+  align-items: center;
+  justify-content: center;
+  box-sizing: border-box;
+  background: rgba($color: #000000, $alpha: 0.5);
+  position: fixed;
+  bottom: 0;
+  left: 0;
+  height: 10.7vw;
+  color: #fff;
+  font-size: 3.7vw;
+}
 .buy-now {
   width: 100%;
   padding: 1vw 3.2vw 1vw 8.4vw;

+ 6 - 6
src/views/shopping-mall/index.vue

@@ -37,7 +37,7 @@ export default {
       this.productList()
     },
     handlerClick ($event) {
-      this.$router.push(`/goods-detail?productId=${$event.productId}&typeId=0`)
+      window.location.href = `/goods-detail?productId=${$event.productId}&typeId=0`
     },
     async productList () {
       const { results: data, hasNextPage } = await productList(this.formData)
@@ -50,15 +50,15 @@ export default {
         // 需在用户可能点击分享按钮前就先调用
         wx.updateAppMessageShareData({
           title: `https://sell-b.caimei365.com/goods-detail?productId=${this.productId}&typeId=0&suid=${this.$store.getters.userId}&isIns=1`, // 分享标题
-          desc: `http://sell-b.caimei365.com/goods-detail?productId=${this.productId}&typeId=0&suid=${this.$store.getters.userId}&isIns=1`, // 分享描述
-          link: `http://sell-b.caimei365.com/goods-detail?productId=${this.productId}&typeId=0&suid=${this.$store.getters.userId}&isIns=1`, // 分享链接,该链接域名或路径必须与当前页面对应的公众号 JS 安全域名一致
-          imgUrl: 'https://static.caimei365.com/app/mini-distribution/qrcode.png' // 分享图标
+          desc: `${process.env.VUE_APP_DATA_API}goods-detail?productId=${this.productId}&typeId=0&suid=${this.$store.getters.userId}&isIns=1`, // 分享描述
+          link: `${process.env.VUE_APP_DATA_API}goods-detail?productId=${this.productId}&typeId=0&suid=${this.$store.getters.userId}&isIns=1`, // 分享链接,该链接域名或路径必须与当前页面对应的公众号 JS 安全域名一致
+          imgUrl: `${process.env.VUE_APP_DATA_API}favicon.png`
         }) // `https://sell-b.caimei365.com/goods-detail?productId=${this.productId}&typeId=0&suid=${this.$store.getters.userId}&isIns=1`
         // wx.onMenuShareAppMessage({
         //  title: `https://sell-b.caimei365.com/goods-detail?productId=${this.productId}&typeId=0&suid=${this.$store.getters.userId}&isIns=1`, // 分享标题
         //  desc: `https://sell-b.caimei365.com/goods-detail?productId=${this.productId}&typeId=0&suid=${this.$store.getters.userId}&isIns=1`, // 分享描述
-        //  link: `http://sell-b.caimei365.com/goods-detail?productId=${this.productId}&typeId=0&suid=${this.$store.getters.userId}&isIns=1`, // 分享链接,该链接域名或路径必须与当前页面对应的公众号 JS 安全域名一致
-        //  imgUrl: 'https://static.caimei365.com/app/mini-distribution/qrcode.png', // 分享图标
+        //  link: `${process.env.VUE_APP_DATA_API}goods-detail?productId=${this.productId}&typeId=0&suid=${this.$store.getters.userId}&isIns=1`, // 分享链接,该链接域名或路径必须与当前页面对应的公众号 JS 安全域名一致
+        //  imgUrl: `${process.env.VUE_APP_DATA_API}favicon.png`, // 分享图标
         //  type: 'link',
         //  success: () => {
         //    console.log('设置成功')