Commit 123367d9 authored by 慕轻风's avatar 慕轻风

wnf

parent e68cd896
...@@ -7,7 +7,7 @@ cloud.init({ ...@@ -7,7 +7,7 @@ cloud.init({
App({ App({
requestType: 'ams', // ams:ams接口,cloud: 云函数 requestType: 'ams', // ams:ams接口,cloud: 云函数
cloudName: 'base', // 主云函数项目名 cloudName: 'CommonToC', // 主云函数项目名
cloud, cloud,
tbcc, tbcc,
onLaunch(options) { onLaunch(options) {
......
...@@ -14,7 +14,7 @@ ...@@ -14,7 +14,7 @@
.goods-modal-container__title { .goods-modal-container__title {
width: 750rpx; width: 750rpx;
height: 120rpx; height: 120rpx;
margin: 29rpx 0 11rpx; margin: 96rpx 0 11rpx;
} }
.goods-modal-container__banner { .goods-modal-container__banner {
width: 750rpx; width: 750rpx;
......
...@@ -29,9 +29,9 @@ Component({ ...@@ -29,9 +29,9 @@ Component({
this.props.onHandleClick(e) this.props.onHandleClick(e)
}, },
// 复制编码 // 复制编码
handleCopyId(e) { async handleCopyId(e) {
const { text } = e.target.dataset || {} const { text } = e.target.dataset || {}
setClipboard({ text }) await setClipboard({ text })
console.log(text) console.log(text)
commonToast('复制成功') commonToast('复制成功')
}, },
......
...@@ -57,44 +57,6 @@ Page({ ...@@ -57,44 +57,6 @@ Page({
async initPage() { async initPage() {
const { activityId } = app const { activityId } = app
const { taskType, itemIds } = this.query const { taskType, itemIds } = this.query
let goodsList = [
{
image: '',
name: '商品名商品名商品名商品名商品名商品名商品名商品商品',
price: '388',
itemId: 617724147979,
collected: false
},
{
image: '',
name: '商品名商品名商品名商品名商品名商品名商品名商品商品',
price: '388',
collected: true,
itemId: 617724563528,
},
{
image: '',
name: '商品名商品名商品名商品名商品名商品名商品名商品商品',
price: '388',
collected: false,
itemId: 617300295119,
},
{
image: '',
name: '商品名商品名商品名商品名商品名商品名商品名商品商品',
price: '388',
collected: true,
itemId: 614139753189,
},
{
image: '',
name: '商品名商品名商品名商品名商品名商品名商品名商品商品',
price: '388',
itemId: 617724147979,
},
]
this.setData({ goodsList })
let handel = taskType == 'collectGoods' ? 'getCollectItemList' : 'getItemListByItemIds' let handel = taskType == 'collectGoods' ? 'getCollectItemList' : 'getItemListByItemIds'
const { success, data } = await API[handel]({ activityId, itemIds }).catch(res => { const { success, data } = await API[handel]({ activityId, itemIds }).catch(res => {
......
'use strict'; 'use strict';
import API from "/api"; import API from "/api";
const app = getApp(); const app = getApp();
const { tbcc } = app; const { tbcc } = app;
const { commonToast, navigateToOutside, getUserAddress, setClipboard } = tbcc.tb; const { commonToast, navigateToOutside, getUserAddress, setClipboard } = tbcc.tb;
const { dateFormatter } = tbcc.utils;
const { PRIZE_TYPE_MAP, PRIZE_DRAW_STATUS_MAP } = tbcc.constants; const { PRIZE_TYPE_MAP, PRIZE_DRAW_STATUS_MAP } = tbcc.constants;
let flag = false; let flag = false;
...@@ -43,16 +45,13 @@ Page({ ...@@ -43,16 +45,13 @@ Page({
// 到期时间 // 到期时间
getEndTime(prizeList = []) { getEndTime(prizeList = []) {
if (!prizeList || !prizeList.length) return null if (!prizeList || !prizeList.length) return null
const endTime = prizeList[0].expiredTime let endTime = prizeList[0].expiredTime
if (!endTime) return null if (!endTime) return null
const t1 = new Date(endTime).toLocaleDateString() + '';//获取年月日
const t2 = new Date(endTime).getHours() + '';//获取时
const t3 = new Date(endTime).getMinutes() + '';//获取分
const t4 = new Date(endTime).getMilliseconds() + '';//获取秒
console.log(endTime, new Date(endTime + 48 * 60 * 60 * 1000).toLocaleString(), 'endTime');
this.setData({ this.setData({
endTime: t1 + " " + t2.padStart(2, '0') + ":" + t3.padStart(2, '0') + ":" + t4.padStart(2, '0') endTime: dateFormatter(endTime, 'yyyy/MM/dd hh:mm:ss')
}) })
console.log(this.data.endTime)
}, },
/** /**
...@@ -73,6 +72,7 @@ Page({ ...@@ -73,6 +72,7 @@ Page({
this.setData({ this.setData({
myPrizeList: data.list myPrizeList: data.list
}) })
console.log(data.list)
this.getEndTime(data.list) this.getEndTime(data.list)
} }
if (type != 'noLoading') { if (type != 'noLoading') {
...@@ -99,7 +99,7 @@ Page({ ...@@ -99,7 +99,7 @@ Page({
const { activityId } = app; const { activityId } = app;
const { item } = e.target.dataset; const { item } = e.target.dataset;
console.log(item, '领取权益') console.log(item, '领取权益')
const { success, data, message } = await API.receiveEnamePrize({ activityId, _id: item._id }).catch(res => { const { success, data, message } = await API.receiveEnamePrize({ activityId, id: item._id || item.id }).catch(res => {
this.getMyPrize('noLoading') this.getMyPrize('noLoading')
commonToast(res && res.message) commonToast(res && res.message)
}) || {}; }) || {};
...@@ -128,13 +128,13 @@ Page({ ...@@ -128,13 +128,13 @@ Page({
activityId, activityId,
name, name,
phone: telNumber, phone: telNumber,
addressdetail: detailInfo, addressDetail: detailInfo,
cityCode, cityCode,
city: cityName, city: cityName,
provice: provinceName, provice: provinceName,
area: countyName, area: countyName,
streetName, streetName,
id: item._id id: item._id || item.id
} }
my.confirm({ my.confirm({
......
const AMS_URL = 'https://ams.dui88.com/server/index.php?g=Web&c=Mock&o=simple&projectID=218&uri='; const AMS_URL = 'https://docs.dui88.com/mock/140/';
const request = ({ cloud, cloudName, requestType = 'cloud' }) => { const request = ({ cloud, cloudName, requestType = 'cloud' }) => {
if (!cloud) { if (!cloud) {
...@@ -32,7 +32,7 @@ const request = ({ cloud, cloudName, requestType = 'cloud' }) => { ...@@ -32,7 +32,7 @@ const request = ({ cloud, cloudName, requestType = 'cloud' }) => {
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
my.request({ my.request({
url: AMS_URL + _cloudName + '.' + handle, url: AMS_URL + _cloudName + '.' + handle,
method, method: "GET",
data: params, data: params,
dataType: 'json' dataType: 'json'
}).then(({ data: res }) => { }).then(({ data: res }) => {
...@@ -69,7 +69,6 @@ const request = ({ cloud, cloudName, requestType = 'cloud' }) => { ...@@ -69,7 +69,6 @@ const request = ({ cloud, cloudName, requestType = 'cloud' }) => {
return requestType === 'ams' ? requestAms() : requestCloud(); return requestType === 'ams' ? requestAms() : requestCloud();
}; };
}; };
export default request; export default request;
\ No newline at end of file
...@@ -520,8 +520,8 @@ export const textRiskIdentification = async (text) => { ...@@ -520,8 +520,8 @@ export const textRiskIdentification = async (text) => {
} }
// 剪切板 // 剪切板
export function setClipboard(params) { export const setClipboard = async (params) => {
return promisifyMyApi('setClipboard', params) return await promisifyMyApi('setClipboard', params)
}; };
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment