lex-wxl 1 день назад
Родитель
Сommit
eff53cc2f2

+ 8 - 0
miniprogram/api/login.ts

@@ -49,6 +49,14 @@ export const api_executeOrder = (params: any) => {
   } as any);
 };
 
+export const api_executeOrderV2 = (params: any) => {
+  return request({
+    url: `/edu-app/userPaymentOrder/miniProgramExecuteOrderV2`,
+    method: "post",
+    data: params,
+  } as any);
+};
+
 /** 用户下单 */
 export const api_executePayment = (params: any) => {
   return request({

+ 1 - 1
miniprogram/config.ts

@@ -1,4 +1,4 @@
-const environmentVariable = "online";
+const environmentVariable = "test";
 const apiUrlInfo = {
   dev: "https://dev.kt.colexiu.com",
   test: "https://test.kt.colexiu.com",

+ 5 - 2
miniprogram/pages/orders/order-detail.ts

@@ -1,5 +1,5 @@
 // pages/orders/order-detail.ts
-import { api_executeOrder, api_executePayment, api_queryByParamName, api_userPaymentOrderDetail, api_userPaymentOrderUnpaid } from "../../api/login";
+import { api_executeOrderV2, api_executePayment, api_queryByParamName, api_userPaymentOrderDetail, api_userPaymentOrderUnpaid } from "../../api/login";
 import { api_sysAreaQueryAllProvince, api_userReceiveAddressPage, api_userReceiveAddressSave } from "../../api/new";
 import { formatPrice, GRADE_ENUM } from "../../utils/util";
 
@@ -28,6 +28,7 @@ Page({
       name: '',
       phoneNumber: ''
     },
+    userNote: '', // 手机号
     userBeneficiaryId: '', // 添加购买人信息
     userBeneficiaryInfo: {
       name: '',
@@ -101,6 +102,7 @@ Page({
       this.setData({
         goodsInfo: infos,
         userBeneficiaryId: options.userBeneficiaryId,
+        userNote: options.userNote,
         status: options.status || '',
         hasInstrument
       }, () => {
@@ -233,7 +235,7 @@ Page({
           this.onPayError()
         }
       } else {
-        const { data } = await api_executeOrder({
+        const { data } = await api_executeOrderV2({
           orderType: "WECHAT_MINI",
           paymentType: this.data.paymentType,
           paymentCashAmount: allSalePrice,
@@ -243,6 +245,7 @@ Page({
           goodsInfos: goodsInfos,
           receiveAddress: this.data.receiveAddress,
           userBeneficiaryId: this.data.userBeneficiaryId,
+          userNote: this.data.userNote,
           orderName: name,
           orderDesc: name
         })

+ 2 - 2
miniprogram/pages/orders/order-detail.wxml

@@ -67,14 +67,14 @@
         </view>
       </view>
 
-      <view class="buyUsers" wx:if="{{ userBeneficiaryId && goodsInfo.orderNo }}">
+      <!-- <view class="buyUsers" wx:if="{{ userBeneficiaryId && goodsInfo.orderNo }}">
         <view class="users">
           <text class="username">{{ userBeneficiaryInfo.name }}</text>{{ userBeneficiaryInfo.phoneNumber }}
         </view>
         <view class="detail">{{userBeneficiaryInfo.schoolInfo}}</view>
 
         <image class="buyuser_img" mode="widthFix" src="./images/buyuser.png"></image>
-      </view>
+      </view> -->
 
       <view class="order-time" wx:if="{{ goodsInfo.orderNo }}">
         <template is="orderInfo" data="{{ goodsInfo }}"></template>

+ 2 - 2
miniprogram/pages/orders/order-result.wxml

@@ -69,14 +69,14 @@
         </view>
       </view>
 
-      <view class="buyUsers">
+      <!-- <view class="buyUsers">
         <view class="users">
           <text class="username">{{ goodsInfo.beneficiary.name }}</text>{{ goodsInfo.beneficiary.phoneNumber }}
         </view>
         <view class="detail">{{goodsInfo.beneficiary.schoolInfo}}</view>
 
         <image class="buyuser_img" mode="widthFix" src="./images/buyuser.png"></image>
-      </view>
+      </view> -->
       <view class="order-time">
         <template is="orderInfo" data="{{ goodsInfo }}"></template>
       </view>

+ 2 - 1
miniprogram/pages/select-goods/index.json

@@ -1,7 +1,8 @@
 {
   "usingComponents": {
     "navigation-bar": "/components/navigation-bar/navigation-bar",
-    "service": "/components/service/service"
+    "service": "/components/service/service",
+    "van-field": "@vant/weapp/field/index"
   },
   "disableScroll": true
 }

+ 7 - 1
miniprogram/pages/select-goods/index.less

@@ -594,4 +594,10 @@
   }
 }
 
-// }
+// }
+
+.addPhone {
+  .van-cell {
+    padding: 0;
+  }
+}

+ 13 - 4
miniprogram/pages/select-goods/index.ts

@@ -27,6 +27,7 @@ Page({
       discountPrice: '' // 已省
     } as any, // 格式化所有选中的数据
 
+    userNote: '', // 手机号
     userBeneficiaryId: '', // 选中用户的编号
     userBeneficiaryInfo: {
       name: '',
@@ -232,10 +233,17 @@ Page({
   onSubmit() {
     // 判断是否登录
     const that = this
-    if (!this.data.userBeneficiaryId) {
+    // if (!this.data.userBeneficiaryId) {
+    //   wx.showToast({
+    //     title: '请添加权益享用人',
+    //     icon: 'none'
+    //   })
+    //   return
+    // }
+    if (!this.data.userNote || !/^1[3456789]\d{9}$/.test(this.data.userNote)) {
       wx.showToast({
-        title: '请添加权益享用人',
-        icon: 'none'
+        title: '请输入正确的手机号',
+        icon: "none"
       })
       return
     }
@@ -282,8 +290,9 @@ Page({
     info = encodeURIComponent(info);
 
     console.log(params, "params")
+    // userBeneficiaryId=${that.data.userBeneficiaryId}
     wx.navigateTo({
-      url: `../orders/order-detail?orderInfo=${info}&userBeneficiaryId=${that.data.userBeneficiaryId}`,
+      url: `../orders/order-detail?orderInfo=${info}&userNote=${this.data.userNote}`,
       success: () => {
         that.setData({
           popupShow: false,

+ 10 - 4
miniprogram/pages/select-goods/index.wxml

@@ -78,14 +78,20 @@
       </view>
     </scroll-view>
     <view class="popupBottom">
-      <view class="select-buyer" wx:if="{{ !userBeneficiaryId }}">
+      <!-- 添加手机号 -->
+      <view class="addPhone">
+          <van-field border="{{false}}" model:value="{{ userNote }}" maxlength="11" type="number" placeholder="请输入权益人手机号" >
+            <view class="required" slot="label">手机号码</view>
+          </van-field>
+        </view>
+      <!-- <view class="select-buyer" wx:if="{{ !userBeneficiaryId }}">
         <view class="desc">
           <image src="./images/icon2.png" class="iconBefore"></image>选择权益享用人
         </view>
         <view class="btn-add" bind:tap="onAddBuyer">添加</view>
-      </view>
+      </view> -->
 
-      <view class="select-buyer selected" wx:else bind:tap="onAddBuyer">
+      <!-- <view class="select-buyer selected" wx:else bind:tap="onAddBuyer">
         <view class="desc">
           <image src="./images/icon2.png" class="iconBefore"></image>选择权益享用人
         </view>
@@ -99,7 +105,7 @@
 
           <image class="icon-edit" src="./images/icon-edit.png"></image>
         </view>
-      </view>
+      </view> -->
 
 
       <!-- 有选择商品的时候 -->