Skip to content

Commit ae9b15f

Browse files
committed
小程序仓库适配多商户优化
1 parent df51678 commit ae9b15f

101 files changed

Lines changed: 537 additions & 188 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

sourcecode/alipay/default/app.js

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -961,4 +961,59 @@ App({
961961
return uuid;
962962
},
963963

964+
// 链接地址事件
965+
url_event(e) {
966+
var value = e.currentTarget.dataset.value || null;
967+
if(value != null)
968+
{
969+
var temp = value.substr(0, 6);
970+
if(temp == 'http:/' || temp == 'https:')
971+
{
972+
this.open_web_view(value);
973+
} else {
974+
if (this.is_tabbar_pages(value))
975+
{
976+
my.switchTab({ url: value });
977+
} else {
978+
my.navigateTo({ url: value });
979+
}
980+
}
981+
}
982+
},
983+
984+
// 剪贴板
985+
text_copy_event(e) {
986+
var value = e.currentTarget.dataset.value || null;
987+
if(value != null)
988+
{
989+
var self = this;
990+
my.setClipboardData({
991+
data: value,
992+
success (res) {
993+
my.getClipboardData({
994+
success (res) {
995+
self.showToast('复制成功', 'success');
996+
}
997+
});
998+
}
999+
});
1000+
} else {
1001+
this.showToast('复制内容为空');
1002+
}
1003+
},
1004+
1005+
// 图片预览
1006+
image_show_event(e) {
1007+
var value = e.currentTarget.dataset.value || null;
1008+
if(value != null)
1009+
{
1010+
my.previewImage({
1011+
current: 0,
1012+
urls: [value]
1013+
});
1014+
} else {
1015+
this.showToast('图片地址为空');
1016+
}
1017+
},
1018+
9641019
});
5.05 KB
Loading
5.18 KB
Loading
3.96 KB
Loading
-4.68 KB
Binary file not shown.
-4.3 KB
Binary file not shown.
-3.28 KB
Binary file not shown.

sourcecode/alipay/default/pages/buy/buy.acss

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,10 @@
5050
.goods-group-hd {
5151
padding: 20rpx 0;
5252
}
53+
.goods-group-icon {
54+
width: 24rpx;
55+
height: 24rpx;
56+
}
5357
.goods-group-title {
5458
font-weight: bold;
5559
vertical-align: middle;

sourcecode/alipay/default/pages/buy/buy.axml

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,11 +36,12 @@
3636
<view class="goods-group-list bg-white spacing-mb" a:for="{{goods_list}}" a:for-item="group">
3737
<!-- 仓库分组 -->
3838
<view class="goods-group-hd oh br-b">
39-
<view class="fl">
40-
<text class="goods-group-title">{{group.name}}</text>
41-
<text a:if="{{(group.alias || null) != null}}" class="goods-group-alias">{{group.alias}}</text>
39+
<view class="fl" onTap="warehouse_group_event" data-value="{{group.url || ''}}">
40+
<image a:if="{{(group.icon || null) != null}}" class="goods-group-icon va-m margin-right-xs" src="{{group.icon}}" mode="aspectFit" />
41+
<text class="goods-group-title va-m">{{group.name}}</text>
42+
<text a:if="{{(group.alias || null) != null}}" class="goods-group-alias va-m">{{group.alias}}</text>
4243
</view>
43-
<view a:if="{{(group.lng || null) != null && (group.lat || null) != null}}" class="fr">
44+
<view a:if="{{(group.lng || null) != null && (group.lat || null) != null && group.lng != 0 && group.lat != 0}}" class="fr">
4445
<view class="goods-group-map-submit br" data-index="{{index}}" onTap="map_event">查看地图</view>
4546
</view>
4647
</view>

sourcecode/alipay/default/pages/buy/buy.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -403,4 +403,9 @@ Page({
403403
this.setData({plugins_points_status: !this.data.plugins_points_status});
404404
this.init();
405405
},
406+
407+
// 仓库事件
408+
warehouse_group_event(e) {
409+
app.url_event(e);
410+
},
406411
});

0 commit comments

Comments
 (0)