Pārlūkot izejas kodu

feat:小主卡订阅消息

zhanghui 1 gadu atpakaļ
vecāks
revīzija
0db3d88cfe

+ 2 - 2
common/js/api.js

@@ -38,9 +38,9 @@ export default {
         })
     },
     //查询订阅消息列表
-    getTemplateList() {
+    getTemplateList(data) {
         return request({
-            url: '/order/subscribe/getTemplateList',
+            url: '/order/subscribe/getTemplateList?type=' + data.type,
             method: 'POST'
         })
     },

+ 3 - 1
orderPages/bookService/index.vue

@@ -406,7 +406,9 @@
 			},
 
 			getTemplateList(){
-				this.$api.getTemplateList().then(res=>{
+				this.$api.getTemplateList({
+					type:1
+				}).then(res=>{
 					this.templateId=res.data.data.data.map(item=>{
 						return item.priTmplId
 					})

+ 3 - 1
orderPages/storeService/index.vue

@@ -409,7 +409,9 @@
 			},
 
 			getTemplateList(){
-				this.$api.getTemplateList().then(res=>{
+				this.$api.getTemplateList({
+					type:1
+				}).then(res=>{
 					this.templateId=res.data.data.data.map(item=>{
 						return item.priTmplId
 					})

+ 35 - 0
pages/my/index.vue

@@ -155,6 +155,36 @@ export default {
   },
 
   methods: {
+
+    getTemplateList(){
+      let that = this
+      that.$api.getTemplateList({
+        type:2
+      }).then(res=>{
+        let templateId = res.data.data.data.map(item=>{
+          return item.priTmplId
+        })
+
+        uni.requestSubscribeMessage({
+          tmplIds: templateId,
+          success: (res) =>{
+            console.log('+++++++++success++++++++',res)
+            let {errMsg,...param} = res
+            that.$api.updateSubscribe(param).then(res=>{
+              console.log('+++++++++++++updateSubscribe+++++++++++++',res)
+            })
+          },
+          fail:(err)=>{
+            console.log('+++++++++++++fail+++++++++++++',err)
+          },
+          complete:(complete)=>{
+
+          }
+        })
+
+      })
+    },
+
     clickListItem(e){
 
       if (e.title === '亲情卡'){
@@ -166,6 +196,11 @@ export default {
             url:e.to
           })
         })
+      }else if (e.title === '服务对象管理'){
+        uni.navigateTo({
+          url:e.to
+        })
+        this.getTemplateList()
       }else {
         uni.navigateTo({
           url:e.to