shish 1 سال پیش
والد
کامیت
19c9acf13a

+ 1 - 0
mallApp/src/pages.json

@@ -73,6 +73,7 @@
             "root": "pages/callback",
             "pages": [
                 { "path": "index" },
+                { "path": "pay", "style": { "navigationBarTitleText": "待付款" } },
                 { "path": "success", "style": { "navigationBarTitleText": "支付成功" } },
                 { "path": "paySuccess", "style": { "navigationBarTitleText": "支付成功" } }
             ]

+ 27 - 27
mallApp/src/pages/callback/index.vue

@@ -1,54 +1,54 @@
 <template>
-  <div class="app-content" :class="[contentClass]">
-    <div class="callback-wrap">
-      <div class="callback-blo">
+  <view class="app-content" :class="[contentClass]">
+    <view class="callback-wrap">
+      <view class="callback-blo">
         <block v-if="pageStatus == 1 || pageStatus == 2">
-          <div class="icon">
+          <view class="icon">
             <i class="iconfont icondaizhifu"></i>
-          </div>
+          </view>
         </block>
         <block v-else>
-          <div class="status-img">
+          <view class="status-img">
             <img :src="`${constant.imgUrl}/retail/callback/success.png`" alt mode="widthFix" />
-          </div>
+          </view>
         </block>
-        <div class="status-text app-size-36 app-bold">{{ pageTit }}</div>
+        <view class="status-text app-size-36 app-bold">{{ pageTit }}</view>
         <block v-if="pageStatus == 1 || pageStatus == 2">
-          <div class="price">
+          <view class="price">
             <span class="app-size-36 app-bold">¥{{ totalPrice }}</span>
-          </div>
-          <div class="order-num app-color-3">订单号: {{ orderSn }}</div>
+          </view>
+          <view class="order-num app-color-3">订单号: {{ orderSn }}</view>
         </block>
         <block v-else-if="pageStatus == 3 && payDiscountPrice >0">
-          <div>
+          <view>
             <span v-if="payDiscountType == 0" class="app-color-2">使用优惠券为您省</span>
             <span v-else-if="payDiscountType == 1" class="app-color-2">会员身份为您省</span>
             <span v-else-if="payDiscountType == 2" class="app-color-2">随机优惠为您省</span>
             <span v-else class="app-color-2">随机优惠为您省</span>
             <span class="app-price">{{ payDiscountPrice }}元</span>
-          </div>
+          </view>
         </block>
         <block v-if="pageStatus == 1 || pageStatus == 2">
-          <div class="call-one-btn">
+          <view class="call-one-btn">
             <view v-if="Number(hdInfo.balance)>0" style="color:green;font-weight:bold;font-size:36upx;margin-top:28upx;">可用余额 ¥{{ parseFloat(hdInfo.balance) }}</view>
             <button v-if="isYeBtnShow" class="button-com green pay-wx" @click="balancePayFn" style="height:100upx;line-height:50upx;">余额支付</button>
             <button v-if="getPayType == 1" class="button-com green pay-wx" @click="wxPayFn" style="height:100upx;line-height:50upx;">微信支付</button>
             <button v-else class="button-com green pay-wx" @click="wxPayFnOld" style="height:100upx;line-height:50upx;">微信支付</button>
-          </div>
+          </view>
         </block>
         <block v-else-if="pageStatus == 3 || pageStatus == 4 || pageStatus == 5">
-          <div class="call-btn-com call-two-btn" v-if="$util.isEmpty(loginInfo)"> <button class="button-com" @click="register()" >注册会员</button> </div>
-          <div class="call-btn-com call-two-btn"> <button class="button-com default" @click="goBackHome()" >返回首页</button></div>
+          <view class="call-btn-com call-two-btn" v-if="$util.isEmpty(loginInfo)"> <button class="button-com" @click="register()" >注册会员</button> </view>
+          <view class="call-btn-com call-two-btn"> <button class="button-com default" @click="goBackHome()" >返回首页</button></view>
         </block>
-      </div>
-      <div class="coupon-wrap" v-if="option.pageStatus == 5">
-        <div class="coupon-img">
+      </view>
+      <view class="coupon-wrap" v-if="option.pageStatus == 5">
+        <view class="coupon-img">
           <img :src="`${constant.imgUrl}/retail/callback/coupon.png`" alt mode="widthFix" />
-        </div>
-        <div class="qrcode-img">
+        </view>
+        <view class="qrcode-img">
           <img :src="`${constant.imgUrl}/retail/images/extension.png`" alt mode="widthFix" />
-        </div>
-      </div>
+        </view>
+      </view>
 
       <!-- #ifdef MP-WEIXIN -->
       <view style="width:100%;margin-top:25upx;text-align:center;">
@@ -58,9 +58,9 @@
       </view>
       <!-- #endif -->
 
-    </div>
-    </alert-module>
-  </div>
+    </view>
+
+  </view>
 </template>
 <script>
 import { mapGetters } from "vuex";

+ 332 - 0
mallApp/src/pages/callback/pay.vue

@@ -0,0 +1,332 @@
+<template>
+  <view class="app-content" :class="[contentClass]">
+    <view class="callback-wrap">
+      <view class="callback-blo">
+        <block v-if="pageStatus == 1 || pageStatus == 2">
+          <view class="icon">
+            <i class="iconfont icondaizhifu"></i>
+          </view>
+        </block>
+        <block v-else>
+          <view class="status-img">
+            <img :src="`${constant.imgUrl}/retail/callback/success.png`" alt mode="widthFix" />
+          </view>
+        </block>
+        <view class="status-text app-size-36 app-bold">{{ pageTit }}</view>
+        <block v-if="pageStatus == 1 || pageStatus == 2">
+          <view class="price">
+            <span class="app-size-36 app-bold">¥{{ totalPrice }}</span>
+          </view>
+          <view class="order-num app-color-3">订单号: {{ orderSn }}</view>
+        </block>
+        <block v-else-if="pageStatus == 3 && payDiscountPrice >0">
+          <view>
+            <span v-if="payDiscountType == 0" class="app-color-2">使用优惠券为您省</span>
+            <span v-else-if="payDiscountType == 1" class="app-color-2">会员身份为您省</span>
+            <span v-else-if="payDiscountType == 2" class="app-color-2">随机优惠为您省</span>
+            <span v-else class="app-color-2">随机优惠为您省</span>
+            <span class="app-price">{{ payDiscountPrice }}元</span>
+          </view>
+        </block>
+        <block v-if="pageStatus == 1 || pageStatus == 2">
+          <view class="call-one-btn">
+            <view v-if="Number(hdInfo.balance)>0" style="color:green;font-weight:bold;font-size:36upx;margin-top:28upx;">可用余额 ¥{{ parseFloat(hdInfo.balance) }}</view>
+            <button v-if="isYeBtnShow" class="button-com green pay-wx" @click="balancePayFn" style="height:100upx;line-height:50upx;">余额支付</button>
+            <button v-if="getPayType == 1" class="button-com green pay-wx" @click="wxPayFn" style="height:100upx;line-height:50upx;">微信支付</button>
+            <button v-else class="button-com green pay-wx" @click="wxPayFnOld" style="height:100upx;line-height:50upx;">微信支付</button>
+          </view>
+        </block>
+        <block v-else-if="pageStatus == 3 || pageStatus == 4 || pageStatus == 5">
+          <view class="call-btn-com call-two-btn" v-if="$util.isEmpty(loginInfo)"> <button class="button-com" @click="register()" >注册会员</button> </view>
+          <view class="call-btn-com call-two-btn"> <button class="button-com default" @click="goBackHome()" >返回首页</button></view>
+        </block>
+      </view>
+      <view class="coupon-wrap" v-if="option.pageStatus == 5">
+        <view class="coupon-img">
+          <img :src="`${constant.imgUrl}/retail/callback/coupon.png`" alt mode="widthFix" />
+        </view>
+        <view class="qrcode-img">
+          <img :src="`${constant.imgUrl}/retail/images/extension.png`" alt mode="widthFix" />
+        </view>
+      </view>
+
+
+    </view>
+  </view>
+</template>
+<script>
+import { mapGetters } from "vuex";
+import ModalModule from "@/components/plugin/modal";
+import AlertModule from "@/components/plugin/alert";
+import wexinPay from "@/utils/pay/wxPay";
+import { getShopUser } from "@/utils/auth";
+import { balancePay, wxPay } from "@/api/order";
+import { postWxCode } from '@/api/mini';
+import { getHdInfo } from '@/api/hd';
+export default {
+  name: "index",
+  components: {
+    ModalModule,
+    AlertModule
+  },
+  data() {
+    return {
+      constant: this.$constant,
+      pageTit: "",
+      pageStatus: 1,
+      contentClass: "",
+      payDiscountPrice: null,
+      payDiscountType: 0,
+      passwordModal: false,
+      form: {
+        payPassword: ""
+      },
+      payCallData: {},
+      setPassModal: false,
+      totalPrice:0,
+      orderSn:'',
+      getPayType:1,
+      hasRequestApi:false,
+      hdInfo:{},
+      isYeBtnShow:false
+    };
+  },
+  computed: {
+    ...mapGetters({ shopUser: "getShopUser",loginInfo:"getLoginInfo" })
+  },
+  methods: {
+    register(){
+      let account = uni.getStorageSync('account')
+      this.$util.pageTo({url: "/pages/login/index?account="+account,type:2})
+    },
+    goBackHome(){
+      this.$util.pageTo({url: "/pages/home/recent",type:3})
+    },
+    init() {
+      this.orderSn = this.option.orderSn ? this.option.orderSn : ''
+      this.getPayType = this.option.getPayType
+      if(this.option.totalPrice){
+        this.totalPrice = parseFloat(Number(this.option.totalPrice))
+      }
+      this.pageStatus = this.option.pageStatus;
+      this.payDiscountPrice = this.option.payDiscountPrice;
+      this.payDiscountType = this.option.payDiscountType;
+      this.initClass(this.pageStatus);
+      getShopUser(true)
+
+      if(this.option.hdId && this.option.hdId>0){
+        getHdInfo({id:this.option.hdId}).then(res=>{
+          if(res.code == 1){
+            this.hdInfo = res.data.hd ? res.data.hd : {}
+            if(Number(this.hdInfo.balance) >= Number(this.totalPrice)){
+              this.isYeBtnShow = true
+            }
+          }
+        })
+      }
+
+    },
+    wxPayFn() {
+      let that = this
+      //解决重复提交问题
+      if(this.hasRequestApi == true){
+        this.$msg('正在请求,请5秒后重试')
+        return false
+      }
+      that.hasRequestApi = true
+      setTimeout(() => {
+        that.hasRequestApi = false
+      },7000)
+
+      uni.showLoading({title: '加载中',mask:true})
+      uni.login({
+        provider: 'weixin',
+        success: res => {
+          postWxCode({ code: res.code }).then(subRes => {
+            uni.hideLoading()
+            if(subRes.data.miniOpenId){
+              let miniOpenId = subRes.data.miniOpenId
+              wxPay({ orderSn: that.orderSn, couponId: that.option.couponId,miniOpenId:miniOpenId }).then(res => {
+                this.payCallData = res.data
+                wexinPay(res.data, that.paySuccess, that.payFail)
+                that.orderSn = res.data.orderSn ? res.data.orderSn : ''
+              })
+            }
+          })
+        }
+      })
+    },
+    wxPayFnOld() {
+      let miniOpenId = uni.getStorageSync('miniOpenId')
+      wxPay({ orderSn: this.orderSn, couponId: this.option.couponId,miniOpenId:miniOpenId }).then(res => {
+        this.payCallData = res.data
+        wexinPay(res.data, this.paySuccess, this.payFail)
+        this.orderSn = res.data.orderSn ? res.data.orderSn : ''
+      })
+    },
+    paySuccess() {
+      this.$util.pageTo({ url: "/pages/callback/paySuccess", type: 2 })
+    },
+    payFail() {
+    },
+    balancePayFn() {
+			let that = this
+			that.$util.confirmModal({content:'确认余额支付?'},() => {
+        balancePay({orderSn:this.orderSn}).then(res=>{
+          if(res.code == 1){
+            this.$util.pageTo({ url:"/pages/callback/paySuccess",type: 2})
+          }
+        })
+      })
+    },
+    hideAlert() {
+      this.$util.pageTo("/pages/user/password");
+    },
+    // 初始样式
+    initClass(val) {
+      switch (val) {
+        case "1":
+          this.pageTit = "待支付";
+          this.contentClass = "awaitPayYe";
+          break;
+        case "2":
+          this.pageTit = "待支付";
+          this.contentClass = "awaitPayWx";
+          break;
+        case "3":
+          this.pageTit = "支付成功";
+          this.contentClass = "successPay";
+          break;
+        case "4":
+          this.pageTit = "评价成功";
+          this.contentClass = "successEval";
+          break;
+        case "5":
+          this.pageTit = "支付成功";
+          this.contentClass = "successPayCode";
+          break;
+        case "6":
+          this.pageTit = "提交成功";
+          this.contentClass = "registerMember";
+          break;
+        default:
+          this.pageTit = "支付成功";
+          this.contentClass = "awaitPayYe";
+          break;
+      }
+      uni.setNavigationBarTitle({
+        title: this.pageTit
+      });
+    }
+  }
+};
+</script>
+<style lang="scss" scoped>
+.app-content {
+  .callback-wrap {
+    padding-top: 50upx;
+    background-image: url("../../static/images/callback/bg.png");
+    background-repeat: no-repeat;
+    background-size: 100% auto;
+    .callback-blo {
+      width: 90%;
+      margin: 0 auto;
+      padding: 70upx 0;
+      background-color: #fff;
+      box-shadow: 2upx 2upx 16upx 0upx rgba(181, 181, 181, 0.29);
+      border-radius: 10upx;
+      text-align: center;
+      // 使用icon
+      .icon {
+        .iconfont {
+          font-size: 170upx;
+        }
+      }
+      // 使用状态图片
+      .status-img {
+        width: 294upx;
+        margin: 0 auto;
+      }
+      .call-btn-com {
+        margin-top:60upx;
+        @include disFlex(center, space-evenly);
+      }
+      // 一个按钮
+      .call-one-btn {
+        .button-com {
+          width: 80%;
+          padding-top: 22upx;
+          padding-bottom: 22upx;
+          font-size: 32upx;
+          margin-top: 40upx;
+        }
+      }
+      // 两个按钮
+      .call-two-btn {
+        .button-com {
+          width: 40%;
+          padding-top: 22upx;
+          padding-bottom: 22upx;
+          font-size: 32upx;
+        }
+      }
+    }
+    // 优惠券
+    .coupon-wrap {
+      width: 96%;
+      margin: 52upx auto 0;
+      position: relative;
+      .qrcode-img {
+        width: 170upx;
+        height: 170upx;
+        position: absolute;
+        top: 40upx;
+        right: 108upx;
+      }
+    }
+  }
+}
+.awaitPayWx,
+.awaitPayYe {
+  .status-text {
+    margin-top: 22upx;
+    margin-bottom: 52upx;
+    color: #ffa92e;
+  }
+  .surplus {
+    margin-top: 22upx;
+    margin-bottom: 38upx;
+  }
+  .icon {
+    .iconfont {
+      color: #ffa92e;
+    }
+  }
+}
+.registerMember,
+.successPay,
+.successPayCode,
+.successEval {
+  .status-text {
+    color: #333;
+    margin-top: 22upx;
+    margin-bottom: 52upx;
+  }
+}
+.registerMember {
+  .call-back-wrap {
+    .qr-code-img {
+      width: 300upx;
+      height: 300upx;
+      margin: 20upx auto;
+      img {
+        height: 100%;
+      }
+    }
+    .app-color-2 {
+      font-size: 30upx;
+      margin-bottom: 20upx;
+    }
+  }
+}
+</style>

+ 6 - 0
mallApp/src/pages/goods/components/buy-foot.vue

@@ -49,6 +49,12 @@ export default {
             width: calc(90% - 30upx);
             font-size: 32upx;
             font-weight: 400;
+            height: 88upx; // 增加按钮高度
+            line-height: 88upx; // 设置行高等于高度,实现垂直居中
+            display: flex; // 使用flex布局
+            align-items: center; // 垂直居中
+            justify-content: center; // 水平居中
+            padding: 0; // 移除默认内边距,使用flex布局控制
         }
     }
 }

+ 6 - 0
mallApp/src/pages/goods/components/sel-popup.vue

@@ -148,6 +148,12 @@ export default {
     .button-com {
       width: 80%;
       font-size: 32upx;
+      height: 88upx; // 增加按钮高度
+      line-height: 88upx; // 设置行高等于高度,实现垂直居中
+      display: flex; // 使用flex布局
+      align-items: center; // 垂直居中
+      justify-content: center; // 水平居中
+      padding: 0; // 移除默认内边距,使用flex布局控制
     }
   }
 

+ 57 - 21
mallApp/src/pages/goods/detail.vue

@@ -8,13 +8,11 @@
       </view>
       <view class="tui-pro-titbox">
         <view class="tui-pro-title app-size-32">{{ data.name }}</view>
-        <button open-type="share" class="tui-share-btn tui-share-position" @click="shareFn">
-          <app-tag type="gray" tui-tag-class="tui-tag-share tui-size" shape="circleLeft" size="small" >
-            <view class="flex-center">
-              <i class="iconfont iconfenxiang"></i>
-              <text class="tui-share-text tui-gray">分享</text>
-            </view>
-          </app-tag>
+        <button open-type="share" class="share-btn" @click="shareFn">
+          <view class="share-icon">
+            <i class="iconfont iconfenxiang"></i>
+          </view>
+          <text class="share-text">分享</text>
         </button>
       </view>
       <view class="shop-express app-color-3">
@@ -167,21 +165,59 @@ export default {
       .tui-pro-title {
         width: 80%;
       }
-      .tui-share-btn {
-        display: block;
-        background: none;
-        margin: 0;
-        padding: 0;
-        border-radius: 0;
-        .tui-share-text {
-          padding-left: 4upx;
-          color: $fontColor3;
+      .share-btn {
+        display: flex;
+        align-items: center;
+        justify-content: center;
+        background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
+        border: none;
+        border-radius: 50upx;
+        padding: 16upx 24upx;
+        box-shadow: 0 4upx 12upx rgba(102, 126, 234, 0.3);
+        transition: all 0.3s ease;
+        position: relative;
+        overflow: hidden;
+        
+        &::before {
+          content: '';
+          position: absolute;
+          top: 0;
+          left: -100%;
+          width: 100%;
+          height: 100%;
+          background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
+          transition: left 0.5s;
+        }
+        
+        &:active {
+          transform: translateY(2upx);
+          box-shadow: 0 2upx 8upx rgba(102, 126, 234, 0.4);
+          
+          &::before {
+            left: 100%;
+          }
+        }
+        
+        .share-icon {
+          display: flex;
+          align-items: center;
+          justify-content: center;
+          width: 32upx;
+          height: 32upx;
+          margin-right: 8upx;
+          
+          .iconfont {
+            font-size: 28upx;
+            color: #fff;
+          }
+        }
+        
+        .share-text {
+          color: #fff;
+          font-size: 26upx;
+          font-weight: 500;
+          letter-spacing: 1upx;
         }
-      }
-      .iconfenxiang {
-        font-size: 26upx;
-        color: $fontColor3;
-        margin-right: 6upx;
       }
     }
     .shop-express {

+ 15 - 7
mallApp/src/pages/order/buy.vue

@@ -39,8 +39,8 @@
         <view class="flex-center">
           <span>应付款</span>
           <span class="app-price">
-            <span></span>
-            <span class="app-size-40">{{ mayPayAmount }}</span>
+            <span></span>
+            <span class="app-size-40">{{ mayPayAmount }}</span>
           </span>
         </view>
         <button class="button-com red" formType="submit">确认</button>
@@ -167,10 +167,11 @@ export default {
       }
       uni.showLoading({mask:true})
       let hdId = this.option.hdId?this.option.hdId:0
+      let account = this.option.account?this.option.account:0
       createOrder({...form, ...this.form,hdId:hdId}).then(res => {
         uni.hideLoading()
         uni.removeStorageSync("buyGoodsDetil")
-        this.$util.pageTo({ url: "/pages/callback/index", type: 2, query: { pageStatus: 1, ...res.data,hdId:hdId } })
+        this.$util.pageTo({ url: "/pages/callback/pay", type: 2, query: { pageStatus: 1, ...res.data,hdId:hdId,account:account } })
       })
     }
   }
@@ -178,9 +179,9 @@ export default {
 </script>
 <style lang='scss' scoped>
 .app-content {
-  padding-bottom: 220upx;
-  min-height: calc(100vh - 220upx);
-  margin-bottom:100upx;
+  padding-bottom: 240upx;
+  min-height: calc(100vh - 240upx);
+  margin-bottom:120upx;
   .module-com {
     margin-bottom: 20upx;
     background-color: #fff;
@@ -244,15 +245,22 @@ export default {
   }
 }
 .page-btn {
-  width: calc(100% - 60upx);
+  width: 100%;
   @include disFlex(center, space-between);
   padding: 0 30upx;
+  height: 120upx;
   .app-price {
     margin-bottom: 8upx;
     margin-left: 4upx;
   }
   .red {
     width: 270upx;
+    height: 80upx;
+    line-height: 80upx;
+    font-size: 32upx;
+    display: flex;
+    align-items: center;
+    justify-content: center;
   }
 }
 ::v-deep.tui-alert-content {

+ 1 - 3
mallApp/src/static/css/common.scss

@@ -401,9 +401,7 @@ body {
 
 .app-footer {
     width: 100%;
-    max-width: 750upx; /*no*/
-    min-width: 320upx; /*no*/
-    height: 100upx;
+    height: 120upx;
     position: fixed;
     text-align: center;
     bottom: 0;