-
Notifications
You must be signed in to change notification settings - Fork 211
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
joeyzzeng
committed
Oct 14, 2024
1 parent
aa4c74d
commit 0a5577b
Showing
21 changed files
with
379 additions
and
131 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
33 changes: 0 additions & 33 deletions
33
miniprogram/tcb-shop/components/cloud-template-checker/index.js
This file was deleted.
Oops, something went wrong.
21 changes: 0 additions & 21 deletions
21
miniprogram/tcb-shop/components/cloud-template-checker/index.wxml
This file was deleted.
Oops, something went wrong.
37 changes: 0 additions & 37 deletions
37
miniprogram/tcb-shop/components/cloud-template-checker/index.wxss
This file was deleted.
Oops, something went wrong.
41 changes: 41 additions & 0 deletions
41
miniprogram/tcb-shop/components/cloud-template-guide/index.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
import { cloudbaseTemplateConfig } from '../../config/index'; | ||
|
||
Component({ | ||
properties: { | ||
show: { | ||
type: Boolean, | ||
value: cloudbaseTemplateConfig.useMock, | ||
}, | ||
title: { | ||
type: String, | ||
value: '替换为真实数据', | ||
}, | ||
text: { | ||
type: String, | ||
value: '当前为体验数据,切换为真实数据请复制下方链接并在浏览器中打开,通过指引帮您快速替换', | ||
}, | ||
url: { | ||
type: String, | ||
value: | ||
'https://tcb.cloud.tencent.com/cloud-admin?_jump_source=wxide_tcb_shop#/cloud-template/detail?tplId=tpl-1sm7qkwQcbBUpZ&appName=electronic-business', | ||
}, | ||
}, | ||
|
||
data: { | ||
dialogShow: false, | ||
}, | ||
|
||
methods: { | ||
open() { | ||
this.setData({ dialogShow: true }); | ||
}, | ||
close() { | ||
this.setData({ dialogShow: false }); | ||
}, | ||
copy() { | ||
wx.setClipboardData({ | ||
data: this.data.url, | ||
}); | ||
}, | ||
}, | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
18 changes: 18 additions & 0 deletions
18
miniprogram/tcb-shop/components/cloud-template-guide/index.wxml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
<view wx:if="{{show}}" class="cloud-template-guide"> | ||
<view class="left"> | ||
<t-icon color="#0052D9" name="info-circle-filled" size="40rpx" /> | ||
当前为体验数据,可替换为真实数据 | ||
</view> | ||
<view class="right" bind:tap="open">去替换></view> | ||
</view> | ||
<t-dialog visible="{{dialogShow}}"> | ||
<view slot="content" class="cloud-template-guide-dialog"> | ||
<view class="title">{{title}}</view> | ||
<view class="text">{{text}}</view> | ||
<view class="url">{{url}}</view> | ||
<view class="btns"> | ||
<t-button class="copy" bind:tap="copy" theme="primary">复制地址</t-button> | ||
<t-button class="close" bind:tap="close" theme="outline">暂不打开</t-button> | ||
</view> | ||
</view> | ||
</t-dialog> |
57 changes: 57 additions & 0 deletions
57
miniprogram/tcb-shop/components/cloud-template-guide/index.wxss
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
.cloud-template-guide { | ||
display: flex; | ||
align-items: center; | ||
justify-content: space-between; | ||
background-color: #f2f3ff; | ||
margin: 20rpx; | ||
padding: 20rpx; | ||
border-radius: 10rpx; | ||
font-size: small; | ||
} | ||
|
||
.cloud-template-guide .left { | ||
gap: 10rpx; | ||
display: flex; | ||
align-items: center; | ||
} | ||
|
||
.cloud-template-guide .right { | ||
align-items: center; | ||
color: #0052d9; | ||
} | ||
|
||
.cloud-template-guide-dialog { | ||
display: flex; | ||
flex-direction: column; | ||
gap: 30rpx; | ||
} | ||
|
||
.cloud-template-guide-dialog .title { | ||
font-size: large; | ||
text-align: center; | ||
} | ||
|
||
.cloud-template-guide-dialog .btns { | ||
display: flex; | ||
justify-content: space-between; | ||
gap: 30rpx; | ||
} | ||
|
||
.cloud-template-guide-dialog .close { | ||
color: #0052d9; | ||
border-color: #0052d9; | ||
border: solid 1rpx #0052d9; | ||
} | ||
|
||
.cloud-template-guide-dialog .text { | ||
color: rgba(0, 0, 0, 0.5); | ||
font-size: small; | ||
} | ||
|
||
.cloud-template-guide-dialog .btns button { | ||
flex: 1; | ||
} | ||
|
||
.cloud-template-guide-dialog .url { | ||
word-break: break-all; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,12 @@ | ||
/** TDesign 使用 */ | ||
export const config = { | ||
/** 是否使用mock代替api返回 */ | ||
useMock: true, | ||
}; | ||
|
||
/** 云开发使用 */ | ||
export const cloudbaseTemplateConfig = { | ||
useMock: true, | ||
}; | ||
|
||
export const cdnBase = 'https://we-retail-static-1300977798.cos.ap-guangzhou.myqcloud.com/retail-mp'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,19 @@ | ||
<cloud-template-checker bindcheck="onCloudCheck" show="{{cloudCheckerShow}}" text="原因可能是模板未完成初始化,请参考 README.md 或打开下方使用文档。" url="https://tcb.cloud.tencent.com/cloud-admin?_jump_source=wxide_tcb_shop#/cloud-template/detail?tplId=tpl-1sm7qkwQcbBUpZ&appName=electronic-business"> | ||
<view style="text-align: center; color: #b9b9b9" wx:if="{{pageLoading}}"> | ||
<t-loading theme="circular" size="40rpx" text="加载中..." inherit-color /> | ||
<cloud-template-guide /> | ||
<view style="text-align: center; color: #b9b9b9" wx:if="{{pageLoading}}"> | ||
<t-loading theme="circular" size="40rpx" text="加载中..." inherit-color /> | ||
</view> | ||
<view class="home-page-header"> | ||
<view class="search" bind:tap="navToSearchPage"> | ||
<t-search t-class-input="t-search__input" t-class-input-container="t-search__input-container" leftIcon="" disabled> | ||
<t-icon slot="left-icon" prefix="wr" name="search" size="40rpx" color="#bbb" /> | ||
</t-search> | ||
</view> | ||
<view class="home-page-header"> | ||
<view class="search" bind:tap="navToSearchPage"> | ||
<t-search t-class-input="t-search__input" t-class-input-container="t-search__input-container" leftIcon="" disabled> | ||
<t-icon slot="left-icon" prefix="wr" name="search" size="40rpx" color="#bbb" /> | ||
</t-search> | ||
</view> | ||
<view class="swiper-wrap"> | ||
<t-swiper wx:if="{{imgSrcs.length > 0}}" current="{{current}}" autoplay="{{autoplay}}" duration="{{duration}}" interval="{{interval}}" navigation="{{navigation}}" imageProps="{{swiperImageProps}}" list="{{imgSrcs}}" /> | ||
</view> | ||
<view class="swiper-wrap"> | ||
<t-swiper wx:if="{{imgSrcs.length > 0}}" current="{{current}}" autoplay="{{autoplay}}" duration="{{duration}}" interval="{{interval}}" navigation="{{navigation}}" imageProps="{{swiperImageProps}}" list="{{imgSrcs}}" /> | ||
</view> | ||
<view class="home-page-container"> | ||
<goods-list wr-class="goods-list-container" goodsList="{{goodsList}}" bind:click="goodListClickHandle" bind:addcart="goodListAddCartHandle" /> | ||
<load-more list-is-empty="{{!goodsList.length}}" status="{{goodsListLoadStatus}}" bind:retry="onReTry" /> | ||
<t-toast id="t-toast" /> | ||
</view> | ||
</cloud-template-checker> | ||
</view> | ||
<view class="home-page-container"> | ||
<goods-list wr-class="goods-list-container" goodsList="{{goodsList}}" bind:click="goodListClickHandle" bind:addcart="goodListAddCartHandle" /> | ||
<load-more list-is-empty="{{!goodsList.length}}" status="{{goodsListLoadStatus}}" bind:retry="onReTry" /> | ||
<t-toast id="t-toast" /> | ||
</view> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.