平板端快衣店
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

159 lines
3.4 KiB

<!-- 管理员登录页 -->
<template>
<view class="page1" style="overflow: scroll;">
<official-account :bindload="successRes" :binderror="errorRes">
<view style="width: 100%;height: 100rpx;background: #000;">关注</view>
</official-account>
</view>
</template>
<script>
export default {
data() {
return {
}
},
onShow() {
},
onLoad(option) {
this.getToken()
},
methods: {
successRes() {
},
//获取code
getToken() {
uni.login({
provider: 'weixin',
success(res) {
console.log(res.code);
// this.getOpenId(res.code)
}
});
},
//获取小程序openid
getOpenId(code) {
this.tui.request("", "post", {
appid: 'wx6d7d4fb58d1502db',
secret: '3a2c8cd00926764bbd12fd7361e01f1d',
js_code: code,
grant_type: "authorization_code",
customId: ''
}, false, false).then((res) => {
this.status = 'nomore';
if (res.code == 200) {
} else {
this.tui.toast(res.message)
}
}).catch((res) => {})
},
//根据openid查询用户信息
getUserInfo(openId) {
this.tui.request("", "post", {
openId: openId
}, false, false).then((res) => {
this.status = 'nomore';
if (res.code == 200) {
} else {
this.tui.toast(res.message)
}
}).catch((res) => {})
},
/*
发送模板消息
⦁对账单模板template_id:xAoOMfWdnT8pwfj_OOskJGKQHVU-8_AYwx1A5I5wBTM
参数:
订单金额:{{amount1.DATA}}
交易时间{{time3.DATA}}
商户名称{{thing4.DATA}}
客户姓名{{thing5.DATA}}
⦁充值成功模板template_id:WKCcMlr0UoXvulrhX-cBUeEELAd_ar_NnAnw30DjnQE
参数:
充值金额{{amount1.DATA}}
充值时间{{time2.DATA}}
账户总额{{amount3.DATA}}
顾客姓名{{thing4.DATA}}
门店名称{{thing11.DATA}}
⦁店铺上新template_id:M45X8AmPi58c16M9YVTMEOhwEVEa9s5md-6i3TwjpRQ
参数:
公司名称{{thing3.DATA}}
提交时间{{time2.DATA}}
*/
sendMessage() {
this.tui.request("", "post", {
touser: "", //openid
template_id: "",
miniprogram: {
appid: "wx6d7d4fb58d1502db",
pagepath: ""
},
data: {
keyword1: {
value: "巧克力"
},
keyword2: {
value: "39.8元"
},
keyword3: {
value: "2014年9月22日"
}
}
}, false, false).then((res) => {
this.status = 'nomore';
if (res.code == 200) {
} else {
this.tui.toast(res.message)
}
}).catch((res) => {})
},
//店铺上新
sendMessageUpNew() {
this.tui.request("", "post", {
wxList: {
template_id:'',
miniprogram: {
appid: "wx6d7d4fb58d1502db",
pagepath: ""
},
data: {
keyword1: {
value: "巧克力"
},
keyword2: {
value: "39.8元"
},
keyword3: {
value: "2014年9月22日"
}
}
},
categoryId: ""
}, false, false).then((res) => {
this.status = 'nomore';
if (res.code == 200) {
} else {
this.tui.toast(res.message)
}
}).catch((res) => {})
}
}
}
</script>
<style lang="scss">
page,
.page1 {
background: #eee;
height: 100%;
}
</style>