Commit e48f7a98 by 杨北旺

插件

1 parent 0ae0d32d
...@@ -112,7 +112,18 @@ ...@@ -112,7 +112,18 @@
"pages/index/index" "pages/index/index"
], ],
"plugins": { "plugins": {
"ticketPlugin": {
"version": "2.0.2",
"provider": "wxd5b8312c3a09901a"
},
"express-plugin": {
"version": "1.2.0",
"provider": "wx1b1f66316b427c74"
},
"collectionPlugin": {
"version": "1.2.0",
"provider": "wx5e90fdd843841356"
}
} }
}, },
{ {
......
// Page({ Page({
// data: {
// list: [{
// id: 1,
// }, {
// id: 2,
// }, {
// id: 3,
// }, {
// id: 4,
// }, {
// id: 5,
// },]
// },
// onLoad(options) { data: {
list: [{
id: 1,
}, {
id: 2,
}, {
id: 3,
}, {
id: 4,
}, {
id: 5,
},]
},
// },
// toJump(e) {
// const { id } = e.currentTarget.dataset
// let url = ''
// const shareCode = '5759S2m7h'
// switch (id) {
// case 1:
// url = `plugin://collectionPlugin/sbkHome?shareCode=${shareCode}&userId=ooPYo45el_GJ55vqhdME5-tqQmaw`
// break;
// case 2:
// url = `plugin://collectionPlugin/sbkHome?shareCode=${shareCode}`
// break;
// case 3:
// url = `plugin://collectionPlugin/naixueHome?shareCode=${shareCode}`
// break;
// case 4:
// url = `plugin://ticketPlugin/home?shareCode=${shareCode}&reLocation=true`
// break;
// case 5:
// url = `plugin://express-plugin/home?shareCode=${shareCode}`
// break;
// default: onLoad(options) {
// break;
// }
// wx.navigateTo({
// url,
// })
// }
// })
const BRAND_ENUM = {
1: {
name: "肯德基",
link: "plugin://collectionPlugin/kfcHome"
},
2: {
name: "星巴克",
link: "plugin://collectionPlugin/sbkHome"
}, },
3: { toJump(e) {
name: "电影票", const { id } = e.currentTarget.dataset
link: "plugin://ticketPlugin/home" let url = ''
const shareCode = '5759S2m7h'
switch (id) {
case 1:
url = `plugin://collectionPlugin/sbkHome?shareCode=${shareCode}&userId=ooPYo45el_GJ55vqhdME5-tqQmaw`
break;
case 2:
url = `plugin://collectionPlugin/sbkHome?shareCode=${shareCode}`
break;
case 3:
url = `plugin://collectionPlugin/naixueHome?shareCode=${shareCode}`
break;
case 4:
url = `plugin://ticketPlugin/home?shareCode=${shareCode}&reLocation=true`
break;
case 5:
url = `plugin://express-plugin/home?shareCode=${shareCode}`
break;
default:
break;
} }
}
Page({
/**
* 页面的初始数据
*/
data: {
BRAND_ENUM
},
/**
* 跳转插件
*/
testJump() {
wx.navigateTo({ wx.navigateTo({
url: 'plugin://collectionPlugin/sbkHome?shareCode=5759S2m7h', url,
})
},
/**
* 测试循环跳转插件
*/
testLoopJump(e) {
const {
item
} = e.currentTarget.dataset
wx.navigateTo({
url: `${item.link}?shareCode=5759S2m7h`,
}) })
} }
}) })
<!-- <view class="container"> <view class="container">
<block wx:for="{{list}}" wx:key="index"> <block wx:for="{{list}}" wx:key="index">
<glsx-image bind:tap="toJump" data-id="{{item.id}}" class="cover" webp src="equity/plugin/equity_plugin_{{index}}.png"></glsx-image> <glsx-image bind:tap="toJump" data-id="{{item.id}}" class="cover" webp src="equity/plugin/equity_plugin_{{index}}.png"></glsx-image>
</block> </block>
</view> -->
<view>
<button bindtap="testJump">点击跳转插件页面</button>
-------------------------------------------------------------
<view>
<view wx:for="{{BRAND_ENUM}}">
<button bindtap="testLoopJump" data-item="{{item}}">{{item.name}}</button>
</view>
</view>
</view> </view>
<glsx-privacy appletName="车生活助手"></glsx-privacy>
\ No newline at end of file \ No newline at end of file
import { IMG_URL } from '~/config';
Page({ Page({
data: { data: {
IMGURL: IMG_URL,
curIndex: 0, curIndex: 0,
checkedItem: 0, checkedItem: 0,
isOpen: false, isOpen: false,
......
const baseUrl = 'https://img02.glsx.com.cn/weapp/resource/equity-h5-new/mini/' import { IMG_URL } from '~/config';
Page({ Page({
data: { data: {
imageURL: baseUrl, IMGURL: IMG_URL,
isOpen: false, isOpen: false,
isHaveInventory: true, isHaveInventory: true,
goodsList: [], goodsList: [],
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!