测试芝麻GO
This commit is contained in:
3
app.json
3
app.json
@@ -34,7 +34,8 @@
|
|||||||
"pages/stages_pay/stages_pay",
|
"pages/stages_pay/stages_pay",
|
||||||
"pages/stages_form/stages_form",
|
"pages/stages_form/stages_form",
|
||||||
"pages/unicom/unicom",
|
"pages/unicom/unicom",
|
||||||
"pages/unicom_form/unicom_form"
|
"pages/unicom_form/unicom_form",
|
||||||
|
"pages/zhima/zhima"
|
||||||
],
|
],
|
||||||
"window": {
|
"window": {
|
||||||
"defaultTitle": " ",
|
"defaultTitle": " ",
|
||||||
|
|||||||
@@ -47,6 +47,10 @@
|
|||||||
<image class="grid-icon" mode="aspectFill" src="../../lib/icon/index_icon_05.png"/>
|
<image class="grid-icon" mode="aspectFill" src="../../lib/icon/index_icon_05.png"/>
|
||||||
<view class="grid-title nowrap">联通专项业务</view>
|
<view class="grid-title nowrap">联通专项业务</view>
|
||||||
</navigator>
|
</navigator>
|
||||||
|
<navigator class="grid-item" url="../zhima/zhima" a:if="{{permissions.zhima == 1}}">
|
||||||
|
<image class="grid-icon" mode="aspectFill" src="../../lib/icon/index_icon_05.png"/>
|
||||||
|
<view class="grid-title nowrap">芝麻GO</view>
|
||||||
|
</navigator>
|
||||||
|
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
|
|||||||
0
pages/zhima/zhima.acss
Normal file
0
pages/zhima/zhima.acss
Normal file
8
pages/zhima/zhima.axml
Normal file
8
pages/zhima/zhima.axml
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
<view>
|
||||||
|
测试开通:总金额(120元),12期,每月8元
|
||||||
|
</view>
|
||||||
|
<view>
|
||||||
|
<button type="primary" onTap="pay">
|
||||||
|
开通
|
||||||
|
</button>
|
||||||
|
</view>
|
||||||
48
pages/zhima/zhima.js
Normal file
48
pages/zhima/zhima.js
Normal file
@@ -0,0 +1,48 @@
|
|||||||
|
const api = require("../../api/api")
|
||||||
|
const app = getApp()
|
||||||
|
|
||||||
|
Page({
|
||||||
|
data: {
|
||||||
|
|
||||||
|
},
|
||||||
|
onLoad() {
|
||||||
|
|
||||||
|
},
|
||||||
|
pay(event) {
|
||||||
|
my.getAuthCode({
|
||||||
|
scopes: ['auth_base', 'auth_user', 'auth_zhima'],
|
||||||
|
success: (res) => {
|
||||||
|
api.request({
|
||||||
|
url: "zhima/auth",
|
||||||
|
header: {
|
||||||
|
"Authorization": app.globalData.token
|
||||||
|
},
|
||||||
|
method: "POST",
|
||||||
|
data: {
|
||||||
|
code: res.authCode,
|
||||||
|
}
|
||||||
|
}).then(res => {
|
||||||
|
console.log(res);
|
||||||
|
})
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
|
my.navigateToMiniService({
|
||||||
|
serviceId: "2019072365974237", // 插件id,固定值勿改
|
||||||
|
servicePage: "pages/hz-enjoy/main/index", // 插件页面地址,固定值勿改
|
||||||
|
extraData: {
|
||||||
|
"alipay.huabei.hz-enjoy.templateId": "2021031700020903000008948043",
|
||||||
|
"alipay.huabei.hz-enjoy.partnerId": "2088731192435005",
|
||||||
|
},
|
||||||
|
success: (res) => {
|
||||||
|
console.log(res);
|
||||||
|
},
|
||||||
|
fail: (error) => {
|
||||||
|
console.log(error);
|
||||||
|
},
|
||||||
|
complete: (res) => {
|
||||||
|
console.log(res);
|
||||||
|
},
|
||||||
|
});
|
||||||
|
},
|
||||||
|
});
|
||||||
1
pages/zhima/zhima.json
Normal file
1
pages/zhima/zhima.json
Normal file
@@ -0,0 +1 @@
|
|||||||
|
{}
|
||||||
Reference in New Issue
Block a user