['不上传打包文件,及不处理商品权证规格字段变更问题']
This commit is contained in:
5
App.vue
5
App.vue
@@ -35,10 +35,11 @@
|
||||
success: (res) => {
|
||||
if (res.confirm) {
|
||||
if (plus.os.name=="Android") {
|
||||
plus.runtime.openURL("https://www.lianshang.vip/app");
|
||||
plus.runtime.openURL(res.info.download);
|
||||
} else{
|
||||
uni.showToast({
|
||||
title: 'IOS应用暂未上架,请打开测试工具点击更新'
|
||||
title: 'IOS应用暂未上架,请打开测试(TestFlight)工具点击更新',
|
||||
icon : 'none'
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
11
apple-app-site-association.json
Normal file
11
apple-app-site-association.json
Normal file
@@ -0,0 +1,11 @@
|
||||
{
|
||||
"applinks": {
|
||||
"apps": [],
|
||||
"details": [
|
||||
{
|
||||
"appID": "io.lianshang.app",
|
||||
"paths": [ "https://www.lianshang.vip/ulink/*"]
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
353
manifest.json
353
manifest.json
@@ -1,180 +1,179 @@
|
||||
{
|
||||
"name" : "链商星球",
|
||||
"appid" : "__UNI__1F65101",
|
||||
"description" : "安徽星煌,链商星球商家工具",
|
||||
"versionName" : "1.0.8",
|
||||
"versionCode" : 108,
|
||||
"transformPx" : false,
|
||||
/* 5+App特有相关 */
|
||||
"app-plus" : {
|
||||
"usingComponents" : true,
|
||||
"nvueStyleCompiler" : "uni-app",
|
||||
"compilerVersion" : 3,
|
||||
"splashscreen" : {
|
||||
"alwaysShowBeforeRender" : true,
|
||||
"waiting" : true,
|
||||
"autoclose" : true,
|
||||
"delay" : 0
|
||||
},
|
||||
"safearea" : {
|
||||
"bottom" : {
|
||||
"offset" : "none"
|
||||
}
|
||||
},
|
||||
/* 模块配置 */
|
||||
"modules" : {
|
||||
"OAuth" : {},
|
||||
"LivePusher" : {},
|
||||
"VideoPlayer" : {},
|
||||
"Push" : {},
|
||||
"Share" : {},
|
||||
"Payment" : {},
|
||||
"Geolocation" : {},
|
||||
"Maps" : {}
|
||||
},
|
||||
/* 应用发布信息 */
|
||||
"distribute" : {
|
||||
/* android打包配置 */
|
||||
"android" : {
|
||||
"permissions" : [
|
||||
"<uses-feature android:name=\"android.hardware.camera\"/>",
|
||||
"<uses-feature android:name=\"android.hardware.camera.autofocus\"/>",
|
||||
"<uses-permission android:name=\"android.permission.ACCESS_COARSE_LOCATION\"/>",
|
||||
"<uses-permission android:name=\"android.permission.ACCESS_NETWORK_STATE\"/>",
|
||||
"<uses-permission android:name=\"android.permission.ACCESS_WIFI_STATE\"/>",
|
||||
"<uses-permission android:name=\"android.permission.CAMERA\"/>",
|
||||
"<uses-permission android:name=\"android.permission.CHANGE_NETWORK_STATE\"/>",
|
||||
"<uses-permission android:name=\"android.permission.CHANGE_WIFI_STATE\"/>",
|
||||
"<uses-permission android:name=\"android.permission.FLASHLIGHT\"/>",
|
||||
"<uses-permission android:name=\"android.permission.GET_ACCOUNTS\"/>",
|
||||
"<uses-permission android:name=\"android.permission.INTERNET\"/>",
|
||||
"<uses-permission android:name=\"android.permission.MODIFY_AUDIO_SETTINGS\"/>",
|
||||
"<uses-permission android:name=\"android.permission.MOUNT_UNMOUNT_FILESYSTEMS\"/>",
|
||||
"<uses-permission android:name=\"android.permission.READ_LOGS\"/>",
|
||||
"<uses-permission android:name=\"android.permission.READ_PHONE_STATE\"/>",
|
||||
"<uses-permission android:name=\"android.permission.RECORD_AUDIO\"/>",
|
||||
"<uses-permission android:name=\"android.permission.VIBRATE\"/>",
|
||||
"<uses-permission android:name=\"android.permission.WAKE_LOCK\"/>",
|
||||
"<uses-permission android:name=\"android.permission.WRITE_EXTERNAL_STORAGE\"/>",
|
||||
"<uses-permission android:name=\"android.permission.WRITE_SETTINGS\"/>"
|
||||
]
|
||||
},
|
||||
/* ios打包配置 */
|
||||
"ios" : {
|
||||
"privacyDescription" : {
|
||||
"NSPhotoLibraryUsageDescription" : "上传图片",
|
||||
"NSPhotoLibraryAddUsageDescription" : "下载图片",
|
||||
"NSCameraUsageDescription" : "扫描二维码",
|
||||
"NSLocationAlwaysAndWhenInUseUsageDescription" : "定位您的店铺地址",
|
||||
"NSRemindersUsageDescription" : "及时通知提醒内容",
|
||||
"NSLocalNetworkUsageDescription" : "使用您的网络获取服务数据"
|
||||
}
|
||||
},
|
||||
/* SDK配置 */
|
||||
"sdkConfigs" : {
|
||||
"ad" : {},
|
||||
"payment" : {
|
||||
"weixin" : {
|
||||
"__platform__" : [ "ios", "android" ],
|
||||
"appid" : "wxd8b146e0a37bab50",
|
||||
"UniversalLinks" : "https://io.lianshang.app"
|
||||
},
|
||||
"alipay" : {
|
||||
"__platform__" : [ "ios", "android" ]
|
||||
}
|
||||
},
|
||||
"oauth" : {
|
||||
"univerify" : {},
|
||||
"weixin" : {
|
||||
"appid" : "wxd8b146e0a37bab50",
|
||||
"appsecret" : "6896afa5d57be13aecaf179c3547a940",
|
||||
"UniversalLinks" : "https://io.lianshang.app"
|
||||
}
|
||||
},
|
||||
"push" : {
|
||||
"unipush" : {}
|
||||
},
|
||||
"share" : {
|
||||
"weixin" : {
|
||||
"appid" : "wxd8b146e0a37bab50",
|
||||
"UniversalLinks" : "https://io.lianshang.app"
|
||||
}
|
||||
},
|
||||
"maps" : {
|
||||
"amap" : {
|
||||
"appkey_ios" : "450192db4bea0af2f226b8c1e1f7b769",
|
||||
"appkey_android" : "6ff79685204ba5f14ae2e898e0d3b8a0"
|
||||
}
|
||||
},
|
||||
"geolocation" : {
|
||||
"amap" : {
|
||||
"__platform__" : [ "ios", "android" ],
|
||||
"appkey_ios" : "450192db4bea0af2f226b8c1e1f7b769",
|
||||
"appkey_android" : "6ff79685204ba5f14ae2e898e0d3b8a0"
|
||||
}
|
||||
}
|
||||
},
|
||||
"icons" : {
|
||||
"android" : {
|
||||
"hdpi" : "unpackage/res/icons/72x72.png",
|
||||
"xhdpi" : "unpackage/res/icons/96x96.png",
|
||||
"xxhdpi" : "unpackage/res/icons/144x144.png",
|
||||
"xxxhdpi" : "unpackage/res/icons/192x192.png"
|
||||
},
|
||||
"ios" : {
|
||||
"appstore" : "unpackage/res/icons/1024x1024.png",
|
||||
"ipad" : {
|
||||
"app" : "unpackage/res/icons/76x76.png",
|
||||
"app@2x" : "unpackage/res/icons/152x152.png",
|
||||
"notification" : "unpackage/res/icons/20x20.png",
|
||||
"notification@2x" : "unpackage/res/icons/40x40.png",
|
||||
"proapp@2x" : "unpackage/res/icons/167x167.png",
|
||||
"settings" : "unpackage/res/icons/29x29.png",
|
||||
"settings@2x" : "unpackage/res/icons/58x58.png",
|
||||
"spotlight" : "unpackage/res/icons/40x40.png",
|
||||
"spotlight@2x" : "unpackage/res/icons/80x80.png"
|
||||
},
|
||||
"iphone" : {
|
||||
"app@2x" : "unpackage/res/icons/120x120.png",
|
||||
"app@3x" : "unpackage/res/icons/180x180.png",
|
||||
"notification@2x" : "unpackage/res/icons/40x40.png",
|
||||
"notification@3x" : "unpackage/res/icons/60x60.png",
|
||||
"settings@2x" : "unpackage/res/icons/58x58.png",
|
||||
"settings@3x" : "unpackage/res/icons/87x87.png",
|
||||
"spotlight@2x" : "unpackage/res/icons/80x80.png",
|
||||
"spotlight@3x" : "unpackage/res/icons/120x120.png"
|
||||
}
|
||||
}
|
||||
},
|
||||
"splashscreen" : {
|
||||
"androidStyle" : "common",
|
||||
"iosStyle" : "common"
|
||||
}
|
||||
}
|
||||
},
|
||||
/* 快应用特有相关 */
|
||||
"quickapp" : {},
|
||||
/* 小程序特有相关 */
|
||||
"mp-weixin" : {
|
||||
"appid" : "",
|
||||
"setting" : {
|
||||
"urlCheck" : false
|
||||
},
|
||||
"usingComponents" : true
|
||||
},
|
||||
"mp-alipay" : {
|
||||
"usingComponents" : true
|
||||
},
|
||||
"mp-baidu" : {
|
||||
"usingComponents" : true
|
||||
},
|
||||
"mp-toutiao" : {
|
||||
"usingComponents" : true
|
||||
},
|
||||
"uniStatistics" : {
|
||||
"enable" : false
|
||||
},
|
||||
"vueVersion" : "2"
|
||||
"name": "链商星球",
|
||||
"appid": "__UNI__1F65101",
|
||||
"description": "安徽星煌,链商星球商家工具",
|
||||
"versionName": "1.0.9",
|
||||
"versionCode": 109,
|
||||
"transformPx": false,
|
||||
/* 5+App特有相关 */
|
||||
"app-plus": {
|
||||
"usingComponents": true,
|
||||
"nvueStyleCompiler": "uni-app",
|
||||
"compilerVersion": 3,
|
||||
"splashscreen": {
|
||||
"alwaysShowBeforeRender": true,
|
||||
"waiting": true,
|
||||
"autoclose": true,
|
||||
"delay": 0
|
||||
},
|
||||
"safearea": {
|
||||
"bottom": {
|
||||
"offset": "none"
|
||||
}
|
||||
},
|
||||
/* 模块配置 */
|
||||
"modules": {
|
||||
"OAuth": {},
|
||||
"LivePusher": {},
|
||||
"VideoPlayer": {},
|
||||
"Push": {},
|
||||
"Share": {},
|
||||
"Payment": {},
|
||||
"Geolocation": {},
|
||||
"Maps": {}
|
||||
},
|
||||
/* 应用发布信息 */
|
||||
"distribute": {
|
||||
/* android打包配置 */
|
||||
"android": {
|
||||
"permissions": [
|
||||
"<uses-feature android:name=\"android.hardware.camera\"/>",
|
||||
"<uses-feature android:name=\"android.hardware.camera.autofocus\"/>",
|
||||
"<uses-permission android:name=\"android.permission.ACCESS_COARSE_LOCATION\"/>",
|
||||
"<uses-permission android:name=\"android.permission.ACCESS_NETWORK_STATE\"/>",
|
||||
"<uses-permission android:name=\"android.permission.ACCESS_WIFI_STATE\"/>",
|
||||
"<uses-permission android:name=\"android.permission.CAMERA\"/>",
|
||||
"<uses-permission android:name=\"android.permission.CHANGE_NETWORK_STATE\"/>",
|
||||
"<uses-permission android:name=\"android.permission.CHANGE_WIFI_STATE\"/>",
|
||||
"<uses-permission android:name=\"android.permission.FLASHLIGHT\"/>",
|
||||
"<uses-permission android:name=\"android.permission.GET_ACCOUNTS\"/>",
|
||||
"<uses-permission android:name=\"android.permission.INTERNET\"/>",
|
||||
"<uses-permission android:name=\"android.permission.MODIFY_AUDIO_SETTINGS\"/>",
|
||||
"<uses-permission android:name=\"android.permission.MOUNT_UNMOUNT_FILESYSTEMS\"/>",
|
||||
"<uses-permission android:name=\"android.permission.READ_LOGS\"/>",
|
||||
"<uses-permission android:name=\"android.permission.READ_PHONE_STATE\"/>",
|
||||
"<uses-permission android:name=\"android.permission.RECORD_AUDIO\"/>",
|
||||
"<uses-permission android:name=\"android.permission.VIBRATE\"/>",
|
||||
"<uses-permission android:name=\"android.permission.WAKE_LOCK\"/>",
|
||||
"<uses-permission android:name=\"android.permission.WRITE_EXTERNAL_STORAGE\"/>",
|
||||
"<uses-permission android:name=\"android.permission.WRITE_SETTINGS\"/>"
|
||||
]
|
||||
},
|
||||
/* ios打包配置 */
|
||||
"ios": {
|
||||
"privacyDescription": {
|
||||
"NSPhotoLibraryUsageDescription": "上传图片",
|
||||
"NSPhotoLibraryAddUsageDescription": "下载图片",
|
||||
"NSCameraUsageDescription": "扫描二维码",
|
||||
"NSLocationAlwaysAndWhenInUseUsageDescription": "定位您的店铺地址",
|
||||
"NSRemindersUsageDescription": "及时通知提醒内容",
|
||||
"NSLocalNetworkUsageDescription": "使用您的网络获取服务数据"
|
||||
}
|
||||
},
|
||||
/* SDK配置 */
|
||||
"sdkConfigs": {
|
||||
"ad": {},
|
||||
"payment": {
|
||||
"weixin": {
|
||||
"__platform__": ["ios", "android"],
|
||||
"appid": "wxd8b146e0a37bab50",
|
||||
"UniversalLinks": "https://lianshang/app/"
|
||||
},
|
||||
"alipay": {
|
||||
"__platform__": ["ios", "android"]
|
||||
}
|
||||
},
|
||||
"oauth": {
|
||||
"univerify": {},
|
||||
"weixin": {
|
||||
"appid": "wxd8b146e0a37bab50",
|
||||
"appsecret": "6896afa5d57be13aecaf179c3547a940",
|
||||
"UniversalLinks": "https://lianshang/app/"
|
||||
}
|
||||
},
|
||||
"push": {
|
||||
"unipush": {}
|
||||
},
|
||||
"share": {
|
||||
"weixin": {
|
||||
"appid": "wxd8b146e0a37bab50",
|
||||
"UniversalLinks": "https://lianshang/app/"
|
||||
}
|
||||
},
|
||||
"maps": {
|
||||
"amap": {
|
||||
"appkey_ios": "450192db4bea0af2f226b8c1e1f7b769",
|
||||
"appkey_android": "6ff79685204ba5f14ae2e898e0d3b8a0"
|
||||
}
|
||||
},
|
||||
"geolocation": {
|
||||
"amap": {
|
||||
"__platform__": ["ios", "android"],
|
||||
"appkey_ios": "450192db4bea0af2f226b8c1e1f7b769",
|
||||
"appkey_android": "6ff79685204ba5f14ae2e898e0d3b8a0"
|
||||
}
|
||||
}
|
||||
},
|
||||
"icons": {
|
||||
"android": {
|
||||
"hdpi": "unpackage/res/icons/72x72.png",
|
||||
"xhdpi": "unpackage/res/icons/96x96.png",
|
||||
"xxhdpi": "unpackage/res/icons/144x144.png",
|
||||
"xxxhdpi": "unpackage/res/icons/192x192.png"
|
||||
},
|
||||
"ios": {
|
||||
"appstore": "unpackage/res/icons/1024x1024.png",
|
||||
"ipad": {
|
||||
"app": "unpackage/res/icons/76x76.png",
|
||||
"app@2x": "unpackage/res/icons/152x152.png",
|
||||
"notification": "unpackage/res/icons/20x20.png",
|
||||
"notification@2x": "unpackage/res/icons/40x40.png",
|
||||
"proapp@2x": "unpackage/res/icons/167x167.png",
|
||||
"settings": "unpackage/res/icons/29x29.png",
|
||||
"settings@2x": "unpackage/res/icons/58x58.png",
|
||||
"spotlight": "unpackage/res/icons/40x40.png",
|
||||
"spotlight@2x": "unpackage/res/icons/80x80.png"
|
||||
},
|
||||
"iphone": {
|
||||
"app@2x": "unpackage/res/icons/120x120.png",
|
||||
"app@3x": "unpackage/res/icons/180x180.png",
|
||||
"notification@2x": "unpackage/res/icons/40x40.png",
|
||||
"notification@3x": "unpackage/res/icons/60x60.png",
|
||||
"settings@2x": "unpackage/res/icons/58x58.png",
|
||||
"settings@3x": "unpackage/res/icons/87x87.png",
|
||||
"spotlight@2x": "unpackage/res/icons/80x80.png",
|
||||
"spotlight@3x": "unpackage/res/icons/120x120.png"
|
||||
}
|
||||
}
|
||||
},
|
||||
"splashscreen": {
|
||||
"androidStyle": "common",
|
||||
"iosStyle": "common"
|
||||
}
|
||||
}
|
||||
},
|
||||
/* 快应用特有相关 */
|
||||
"quickapp": {},
|
||||
/* 小程序特有相关 */
|
||||
"mp-weixin": {
|
||||
"appid": "",
|
||||
"setting": {
|
||||
"urlCheck": false
|
||||
},
|
||||
"usingComponents": true
|
||||
},
|
||||
"mp-alipay": {
|
||||
"usingComponents": true
|
||||
},
|
||||
"mp-baidu": {
|
||||
"usingComponents": true
|
||||
},
|
||||
"mp-toutiao": {
|
||||
"usingComponents": true
|
||||
},
|
||||
"uniStatistics": {
|
||||
"enable": false
|
||||
},
|
||||
"vueVersion": "2"
|
||||
}
|
||||
/* SDK配置 */
|
||||
|
||||
|
||||
@@ -225,7 +225,7 @@
|
||||
},
|
||||
fail: (err) => {
|
||||
uni.showToast({
|
||||
title: '支付失败',
|
||||
title: '支付失败' + err.message,
|
||||
duration: 3000,
|
||||
mask: true,
|
||||
icon: 'none'
|
||||
|
||||
@@ -189,14 +189,11 @@
|
||||
let typeAuth = '',
|
||||
pathName = ''
|
||||
|
||||
if (this.userAuth.certification && this.userAuth.company && this.userAuth.vip) {
|
||||
if (this.userAuth.company && this.userAuth.vip) {
|
||||
this.$Router.push({
|
||||
name: 'goodsManagement'
|
||||
})
|
||||
return
|
||||
} else if (!this.userAuth.certification) {
|
||||
typeAuth = '暂未完成个人认证,无法发布商品权证'
|
||||
pathName = 'Personal'
|
||||
} else if (!this.userAuth.vip) {
|
||||
typeAuth = '暂未开通平台VIP会员节点,无法发布商品权证'
|
||||
pathName = 'vipIndex'
|
||||
@@ -284,14 +281,6 @@
|
||||
this.chains = occData.data
|
||||
this.categoryArr = occData.tasks
|
||||
this.help = occData.help
|
||||
|
||||
console.log(occData.movement)
|
||||
|
||||
// occData.movement.map((val, index) => {
|
||||
// val.value = index
|
||||
// return val
|
||||
// })
|
||||
|
||||
this.showCartc(occData.movement)
|
||||
}).catch(err => {
|
||||
uni.showToast({
|
||||
|
||||
@@ -97,17 +97,20 @@
|
||||
<no-list v-if="stores.length === 0" name='no-shop' txt="没有任何门店哦~" />
|
||||
</scroll-view>
|
||||
</u-popup>
|
||||
|
||||
<!-- 二维码展示动画效果 -->
|
||||
<view class="showCode " v-if="showCode">
|
||||
<view class="showCodeBg" @click="showCode = false"></view>
|
||||
<view :class="['showCodeContent', showCode?'showCodeContentSelect':'showCodeContentSelectNo']">
|
||||
<view class="showCodeTitle">提货二维码</view>
|
||||
<image :src="showCodeImg" mode="widthFix"></image>
|
||||
<view class="outTime">
|
||||
<uni-countdown class="outTime-down" color="#8b64fd" splitorColor="#8b64fd" :showDay="false" :showHour="false" :minute="codeOutTime" @timeup="onTimeUp">
|
||||
<template #PromptText>后过期</template>
|
||||
</uni-countdown>
|
||||
</view>
|
||||
<view class="showCodeDes">此码请小心保管,丢失或被用不退不换</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- <u-toast ref="uToast" /> -->
|
||||
<u-toast ref="uToast" />
|
||||
</view>
|
||||
@@ -147,7 +150,8 @@
|
||||
store_Name: '', // 门店名称
|
||||
qty: 1,
|
||||
showCode:false,
|
||||
showCodeImg:'',
|
||||
showCodeImg: '',
|
||||
codeOutTime: '',
|
||||
loaded:false
|
||||
};
|
||||
},
|
||||
@@ -168,6 +172,7 @@
|
||||
methods: {
|
||||
getInfo(symbol) {
|
||||
mallWarrantsList(symbol).then(res => {
|
||||
this.codeOutTime = res.validity
|
||||
this.account = res.account
|
||||
this.address = res.address
|
||||
this.addresses = res.addresses
|
||||
@@ -268,8 +273,19 @@
|
||||
|
||||
}
|
||||
})
|
||||
},
|
||||
// 倒计时
|
||||
onTimeUp(e){
|
||||
uni.showModal({
|
||||
title: '提示',
|
||||
content: '二维码已过期,请重新获取',
|
||||
showCancel: false,
|
||||
success: res => {
|
||||
this.showCodeImg = ''
|
||||
this.showCode = false
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
</script>
|
||||
@@ -719,7 +735,8 @@
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
box-sizing: border-box;
|
||||
padding: 30rpx;
|
||||
padding: 70rpx 30rpx;
|
||||
margin-bottom: 10vh;
|
||||
position: relative;
|
||||
z-index: 199;
|
||||
|
||||
@@ -738,6 +755,14 @@
|
||||
color: gray;
|
||||
font-size: 24rpx;
|
||||
}
|
||||
|
||||
.outTime{
|
||||
padding: $padding 0 0;
|
||||
.outTime-down{
|
||||
color: $text-price;
|
||||
font-size: 32rpx;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@keyframes sk-foldCubeAngle {
|
||||
|
||||
14
uni_modules/uni-countdown/changelog.md
Normal file
14
uni_modules/uni-countdown/changelog.md
Normal file
@@ -0,0 +1,14 @@
|
||||
## 1.1.2(2021-08-24)
|
||||
- 新增 支持国际化
|
||||
## 1.1.1(2021-07-30)
|
||||
- 优化 vue3下小程序事件警告的问题
|
||||
## 1.1.0(2021-07-30)
|
||||
- 组件兼容 vue3,如何创建vue3项目,详见 [uni-app 项目支持 vue3 介绍](https://ask.dcloud.net.cn/article/37834)
|
||||
## 1.0.5(2021-06-18)
|
||||
- 修复 uni-countdown 重复赋值跳两秒的 bug
|
||||
## 1.0.4(2021-05-12)
|
||||
- 新增 组件示例地址
|
||||
## 1.0.3(2021-05-08)
|
||||
- 修复 uni-countdown 不能控制倒计时的 bug
|
||||
## 1.0.2(2021-02-04)
|
||||
- 调整为uni_modules目录规范
|
||||
@@ -0,0 +1,6 @@
|
||||
{
|
||||
"uni-countdown.day": "day",
|
||||
"uni-countdown.h": "h",
|
||||
"uni-countdown.m": "m",
|
||||
"uni-countdown.s": "s"
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
import en from './en.json'
|
||||
import zhHans from './zh-Hans.json'
|
||||
import zhHant from './zh-Hant.json'
|
||||
export default {
|
||||
en,
|
||||
'zh-Hans': zhHans,
|
||||
'zh-Hant': zhHant
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
{
|
||||
"uni-countdown.day": "天",
|
||||
"uni-countdown.h": "时",
|
||||
"uni-countdown.m": "分",
|
||||
"uni-countdown.s": "秒"
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
{
|
||||
"uni-countdown.day": "天",
|
||||
"uni-countdown.h": "時",
|
||||
"uni-countdown.m": "分",
|
||||
"uni-countdown.s": "秒"
|
||||
}
|
||||
@@ -0,0 +1,265 @@
|
||||
<template>
|
||||
<view class="uni-countdown">
|
||||
<text v-if="showDay" :style="{ borderColor: borderColor, color: color, backgroundColor: backgroundColor }"
|
||||
class="uni-countdown__number">{{ d }}</text>
|
||||
<text v-if="showDay" :style="{ color: splitorColor }" class="uni-countdown__splitor">{{dayText}}</text>
|
||||
<text v-if="showHour" :style="{ borderColor: borderColor, color: color, backgroundColor: backgroundColor }"
|
||||
class="uni-countdown__number">{{ h }}</text>
|
||||
<text v-if="showHour" :style="{ color: splitorColor }" class="uni-countdown__splitor">{{ showColon ? ':' : hourText }}</text>
|
||||
<text :style="{ borderColor: borderColor, color: color, backgroundColor: backgroundColor }"
|
||||
class="uni-countdown__number">{{ i }}</text>
|
||||
<text :style="{ color: splitorColor }" class="uni-countdown__splitor">{{ showColon ? ':' : minuteText }}</text>
|
||||
<text :style="{ borderColor: borderColor, color: color, backgroundColor: backgroundColor }"
|
||||
class="uni-countdown__number">{{ s }}</text>
|
||||
<text v-if="!showColon" :style="{ color: splitorColor }" class="uni-countdown__splitor">{{secondText}}</text>
|
||||
<slot name="PromptText"></slot>
|
||||
</view>
|
||||
</template>
|
||||
<script>
|
||||
import {
|
||||
initVueI18n
|
||||
} from '@dcloudio/uni-i18n'
|
||||
import messages from './i18n/index.js'
|
||||
const { t } = initVueI18n(messages)
|
||||
/**
|
||||
* Countdown 倒计时
|
||||
* @description 倒计时组件
|
||||
* @tutorial https://ext.dcloud.net.cn/plugin?id=25
|
||||
* @property {String} backgroundColor 背景色
|
||||
* @property {String} color 文字颜色
|
||||
* @property {Number} day 天数
|
||||
* @property {Number} hour 小时
|
||||
* @property {Number} minute 分钟
|
||||
* @property {Number} second 秒
|
||||
* @property {Number} timestamp 时间戳
|
||||
* @property {Boolean} showDay = [true|false] 是否显示天数
|
||||
* @property {Boolean} showColon = [true|false] 是否以冒号为分隔符
|
||||
* @property {String} splitorColor 分割符号颜色
|
||||
* @event {Function} timeup 倒计时时间到触发事件
|
||||
* @example <uni-countdown :day="1" :hour="1" :minute="12" :second="40"></uni-countdown>
|
||||
*/
|
||||
export default {
|
||||
name: 'UniCountdown',
|
||||
emits:['timeup'],
|
||||
props: {
|
||||
showDay: {
|
||||
type: Boolean,
|
||||
default: true
|
||||
},
|
||||
showHour: {
|
||||
type: Boolean,
|
||||
default: true
|
||||
},
|
||||
showColon: {
|
||||
type: Boolean,
|
||||
default: true
|
||||
},
|
||||
start: {
|
||||
type: Boolean,
|
||||
default: true
|
||||
},
|
||||
backgroundColor: {
|
||||
type: String,
|
||||
default: '#FFFFFF'
|
||||
},
|
||||
borderColor: {
|
||||
type: String,
|
||||
default: '#000000'
|
||||
},
|
||||
color: {
|
||||
type: String,
|
||||
default: '#000000'
|
||||
},
|
||||
splitorColor: {
|
||||
type: String,
|
||||
default: '#000000'
|
||||
},
|
||||
day: {
|
||||
type: Number,
|
||||
default: 0
|
||||
},
|
||||
hour: {
|
||||
type: Number,
|
||||
default: 0
|
||||
},
|
||||
minute: {
|
||||
type: Number,
|
||||
default: 0
|
||||
},
|
||||
second: {
|
||||
type: Number,
|
||||
default: 0
|
||||
},
|
||||
timestamp: {
|
||||
type: Number,
|
||||
default: 0
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
timer: null,
|
||||
syncFlag: false,
|
||||
d: '00',
|
||||
h: '00',
|
||||
i: '00',
|
||||
s: '00',
|
||||
leftTime: 0,
|
||||
seconds: 0
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
dayText() {
|
||||
return t("uni-countdown.day")
|
||||
},
|
||||
hourText(val) {
|
||||
return t("uni-countdown.h")
|
||||
},
|
||||
minuteText(val) {
|
||||
return t("uni-countdown.m")
|
||||
},
|
||||
secondText(val) {
|
||||
return t("uni-countdown.s")
|
||||
},
|
||||
},
|
||||
watch: {
|
||||
day(val) {
|
||||
this.changeFlag()
|
||||
},
|
||||
hour(val) {
|
||||
this.changeFlag()
|
||||
},
|
||||
minute(val) {
|
||||
this.changeFlag()
|
||||
},
|
||||
second(val) {
|
||||
this.changeFlag()
|
||||
},
|
||||
start: {
|
||||
immediate: true,
|
||||
handler(newVal, oldVal) {
|
||||
if (newVal) {
|
||||
this.startData();
|
||||
} else {
|
||||
if (!oldVal) return
|
||||
clearInterval(this.timer)
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
},
|
||||
created: function(e) {
|
||||
this.seconds = this.toSeconds(this.timestamp, this.day, this.hour, this.minute, this.second)
|
||||
this.countDown()
|
||||
},
|
||||
// #ifndef VUE3
|
||||
destroyed() {
|
||||
clearInterval(this.timer)
|
||||
},
|
||||
// #endif
|
||||
// #ifdef VUE3
|
||||
unmounted() {
|
||||
clearInterval(this.timer)
|
||||
},
|
||||
// #endif
|
||||
methods: {
|
||||
toSeconds(timestamp, day, hours, minutes, seconds) {
|
||||
if (timestamp) {
|
||||
return timestamp - parseInt(new Date().getTime() / 1000, 10)
|
||||
}
|
||||
return day * 60 * 60 * 24 + hours * 60 * 60 + minutes * 60 + seconds
|
||||
},
|
||||
timeUp() {
|
||||
clearInterval(this.timer)
|
||||
this.$emit('timeup')
|
||||
},
|
||||
countDown() {
|
||||
let seconds = this.seconds
|
||||
let [day, hour, minute, second] = [0, 0, 0, 0]
|
||||
if (seconds > 0) {
|
||||
day = Math.floor(seconds / (60 * 60 * 24))
|
||||
hour = Math.floor(seconds / (60 * 60)) - (day * 24)
|
||||
minute = Math.floor(seconds / 60) - (day * 24 * 60) - (hour * 60)
|
||||
second = Math.floor(seconds) - (day * 24 * 60 * 60) - (hour * 60 * 60) - (minute * 60)
|
||||
} else {
|
||||
this.timeUp()
|
||||
}
|
||||
if (day < 10) {
|
||||
day = '0' + day
|
||||
}
|
||||
if (hour < 10) {
|
||||
hour = '0' + hour
|
||||
}
|
||||
if (minute < 10) {
|
||||
minute = '0' + minute
|
||||
}
|
||||
if (second < 10) {
|
||||
second = '0' + second
|
||||
}
|
||||
this.d = day
|
||||
this.h = hour
|
||||
this.i = minute
|
||||
this.s = second
|
||||
},
|
||||
startData() {
|
||||
this.seconds = this.toSeconds(this.timestamp, this.day, this.hour, this.minute, this.second)
|
||||
if (this.seconds <= 0) {
|
||||
return
|
||||
}
|
||||
clearInterval(this.timer)
|
||||
this.countDown()
|
||||
this.timer = setInterval(() => {
|
||||
this.seconds--
|
||||
if (this.seconds < 0) {
|
||||
this.timeUp()
|
||||
return
|
||||
}
|
||||
this.countDown()
|
||||
}, 1000)
|
||||
},
|
||||
changeFlag() {
|
||||
if (!this.syncFlag) {
|
||||
this.seconds = this.toSeconds(this.timestamp, this.day, this.hour, this.minute, this.second)
|
||||
this.startData();
|
||||
this.syncFlag = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
$countdown-height: 48rpx;
|
||||
$countdown-width: 52rpx;
|
||||
|
||||
.uni-countdown {
|
||||
/* #ifndef APP-NVUE */
|
||||
display: flex;
|
||||
/* #endif */
|
||||
flex-direction: row;
|
||||
justify-content: flex-start;
|
||||
padding: 2rpx 0;
|
||||
}
|
||||
|
||||
.uni-countdown__splitor {
|
||||
/* #ifndef APP-NVUE */
|
||||
display: flex;
|
||||
/* #endif */
|
||||
justify-content: center;
|
||||
line-height: $countdown-height;
|
||||
padding: 0;
|
||||
font-size: 32rpx;
|
||||
}
|
||||
|
||||
.uni-countdown__number {
|
||||
/* #ifndef APP-NVUE */
|
||||
display: flex;
|
||||
/* #endif */
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
width: $countdown-width;
|
||||
height: $countdown-height;
|
||||
line-height: $countdown-height;
|
||||
margin: 0;
|
||||
text-align: center;
|
||||
font-size: 32rpx;
|
||||
}
|
||||
</style>
|
||||
86
uni_modules/uni-countdown/package.json
Normal file
86
uni_modules/uni-countdown/package.json
Normal file
@@ -0,0 +1,86 @@
|
||||
{
|
||||
"id": "uni-countdown",
|
||||
"displayName": "uni-countdown 倒计时",
|
||||
"version": "1.1.2",
|
||||
"description": "CountDown 倒计时组件",
|
||||
"keywords": [
|
||||
"uni-ui",
|
||||
"uniui",
|
||||
"countdown",
|
||||
"倒计时"
|
||||
],
|
||||
"repository": "https://github.com/dcloudio/uni-ui",
|
||||
"engines": {
|
||||
"HBuilderX": ""
|
||||
},
|
||||
"directories": {
|
||||
"example": "../../temps/example_temps"
|
||||
},
|
||||
"dcloudext": {
|
||||
"category": [
|
||||
"前端组件",
|
||||
"通用组件"
|
||||
],
|
||||
"sale": {
|
||||
"regular": {
|
||||
"price": "0.00"
|
||||
},
|
||||
"sourcecode": {
|
||||
"price": "0.00"
|
||||
}
|
||||
},
|
||||
"contact": {
|
||||
"qq": ""
|
||||
},
|
||||
"declaration": {
|
||||
"ads": "无",
|
||||
"data": "无",
|
||||
"permissions": "无"
|
||||
},
|
||||
"npmurl": "https://www.npmjs.com/package/@dcloudio/uni-ui"
|
||||
},
|
||||
"uni_modules": {
|
||||
"dependencies": [],
|
||||
"encrypt": [],
|
||||
"platforms": {
|
||||
"cloud": {
|
||||
"tcb": "y",
|
||||
"aliyun": "y"
|
||||
},
|
||||
"client": {
|
||||
"App": {
|
||||
"app-vue": "y",
|
||||
"app-nvue": "y"
|
||||
},
|
||||
"H5-mobile": {
|
||||
"Safari": "y",
|
||||
"Android Browser": "y",
|
||||
"微信浏览器(Android)": "y",
|
||||
"QQ浏览器(Android)": "y"
|
||||
},
|
||||
"H5-pc": {
|
||||
"Chrome": "y",
|
||||
"IE": "y",
|
||||
"Edge": "y",
|
||||
"Firefox": "y",
|
||||
"Safari": "y"
|
||||
},
|
||||
"小程序": {
|
||||
"微信": "y",
|
||||
"阿里": "y",
|
||||
"百度": "y",
|
||||
"字节跳动": "y",
|
||||
"QQ": "y"
|
||||
},
|
||||
"快应用": {
|
||||
"华为": "u",
|
||||
"联盟": "u"
|
||||
},
|
||||
"Vue": {
|
||||
"vue2": "y",
|
||||
"vue3": "u"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
57
uni_modules/uni-countdown/readme.md
Normal file
57
uni_modules/uni-countdown/readme.md
Normal file
@@ -0,0 +1,57 @@
|
||||
|
||||
|
||||
## CountDown 倒计时
|
||||
> **组件名:uni-countdown**
|
||||
> 代码块: `uCountDown`
|
||||
|
||||
|
||||
倒计时组件。
|
||||
|
||||
### 安装方式
|
||||
|
||||
本组件符合[easycom](https://uniapp.dcloud.io/collocation/pages?id=easycom)规范,`HBuilderX 2.5.5`起,只需将本组件导入项目,在页面`template`中即可直接使用,无需在页面中`import`和注册`components`。
|
||||
|
||||
如需通过`npm`方式使用`uni-ui`组件,另见文档:[https://ext.dcloud.net.cn/plugin?id=55](https://ext.dcloud.net.cn/plugin?id=55)
|
||||
|
||||
### 基本用法
|
||||
|
||||
在 ``template`` 中使用组件
|
||||
|
||||
```html
|
||||
<!-- 一般用法 -->
|
||||
<uni-countdown :day="1" :hour="1" :minute="12" :second="40"></uni-countdown>
|
||||
|
||||
<!-- 不显示天数 -->
|
||||
<uni-countdown :show-day="false" :hour="12" :minute="12" :second="12"></uni-countdown>
|
||||
|
||||
<!-- 修改颜色 -->
|
||||
<uni-countdown color="#FFFFFF" background-color="#00B26A" border-color="#00B26A" :day="1" :hour="2" :minute="30" :second="0"></uni-countdown>
|
||||
```
|
||||
|
||||
## API
|
||||
|
||||
### Countdown Props
|
||||
|
||||
|属性名 |类型 |默认值 |说明 |
|
||||
|:-: |:-: |:-: |:-: |
|
||||
|backgroundColor |String |#FFFFFF|背景色 |
|
||||
|color |String |#000000|文字颜色 |
|
||||
|splitorColor |String |#000000|分割符号颜色 |
|
||||
|day |Number |0 |天数 |
|
||||
|hour |Number |0 |小时 |
|
||||
|minute |Number |0 |分钟 |
|
||||
|second |Number |0 |秒 |
|
||||
|showDay |Boolean|true |是否显示天数 |
|
||||
|showColon |Boolean|true |是否以冒号为分隔符 |
|
||||
|start |Boolean|true |是否初始化组件后就开始倒计时|
|
||||
|
||||
### Countdown Events
|
||||
|
||||
|事件称名 |说明 |返回值 |
|
||||
|:-: |:-: |:-: |
|
||||
|@timeup|倒计时时间到触发事件 |- |
|
||||
|
||||
|
||||
## 组件示例
|
||||
|
||||
点击查看:[https://hellouniapp.dcloud.net.cn/pages/extUI/countdown/countdown](https://hellouniapp.dcloud.net.cn/pages/extUI/countdown/countdown)
|
||||
21
unpackage/dist/build/app-plus/app-service.js
vendored
21
unpackage/dist/build/app-plus/app-service.js
vendored
File diff suppressed because one or more lines are too long
1
unpackage/dist/build/app-plus/app-view.js
vendored
1
unpackage/dist/build/app-plus/app-view.js
vendored
File diff suppressed because one or more lines are too long
1
unpackage/dist/build/app-plus/manifest.json
vendored
1
unpackage/dist/build/app-plus/manifest.json
vendored
File diff suppressed because one or more lines are too long
47775
unpackage/dist/dev/app-plus/app-service.js
vendored
47775
unpackage/dist/dev/app-plus/app-service.js
vendored
File diff suppressed because one or more lines are too long
1
unpackage/dist/dev/app-plus/manifest.json
vendored
1
unpackage/dist/dev/app-plus/manifest.json
vendored
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user