浏览代码

售后申请接口加参数

LiuShu_0203 3 周之前
父节点
当前提交
79e5920179
共有 1 个文件被更改,包括 28 次插入2 次删除
  1. 28 2
      subpackages/afterservice/afterservice.js

+ 28 - 2
subpackages/afterservice/afterservice.js

@@ -10,8 +10,32 @@ Page({
   onLoad(options) {
     const itemData = decodeURIComponent(options.data);
     const item = JSON.parse(itemData);
-    this.setData({ item });
+    this.setData({ item }, () => {
+      this.getadddizhi()
+    });
+
+  },
 
+  async getadddizhi() {
+    const { data } = await models.adresses.get({
+      filter: {
+        where: {
+          $and: [
+            {
+              _id: {
+                $eq: this.data.item.adresses_id, // 推荐传入_id数据标识进行操作
+              },
+            },
+          ]
+        }
+      },
+      // envType: pre 体验环境, prod 正式环境
+      envType: "prod",
+    });
+    
+    // 返回查询到的数据
+    this.data.item.phone = data.phone
+    console.log(this.data.item.phone, '*----------------');
   },
 
   // 上传图片
@@ -107,7 +131,8 @@ Page({
       const school_id = this.data.item.schools_id || "";
       const user_id = this.data.item.user_id || "";
       const order_id = this.data.item.orders_id || "";
-      console.log(this.data.item, 'goods_id',);
+      
+      const phone = this.data.item.update_phone ? this.data.item.update_phone : this.data.item.phone ? this.data.item.phone : ''
   
       const { data } = await models.wx_afterservice.create({
         data: {
@@ -118,6 +143,7 @@ Page({
           user_id,
           state: 0,
           order_id,
+          phone,
         },
         envType: "prod",
       });