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

wnf

parent e68cd896
......@@ -7,7 +7,7 @@ cloud.init({
App({
requestType: 'ams', // ams:ams接口,cloud: 云函数
cloudName: 'base', // 主云函数项目名
cloudName: 'CommonToC', // 主云函数项目名
cloud,
tbcc,
onLaunch(options) {
......
......@@ -14,7 +14,7 @@
.goods-modal-container__title {
width: 750rpx;
height: 120rpx;
margin: 29rpx 0 11rpx;
margin: 96rpx 0 11rpx;
}
.goods-modal-container__banner {
width: 750rpx;
......
......@@ -29,9 +29,9 @@ Component({
this.props.onHandleClick(e)
},
// 复制编码
handleCopyId(e) {
async handleCopyId(e) {
const { text } = e.target.dataset || {}
setClipboard({ text })
await setClipboard({ text })
console.log(text)
commonToast('复制成功')
},
......
......@@ -57,44 +57,6 @@ Page({
async initPage() {
const { activityId } = app
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'
const { success, data } = await API[handel]({ activityId, itemIds }).catch(res => {
......
'use strict';
import API from "/api";
const app = getApp();
const { tbcc } = app;
const { commonToast, navigateToOutside, getUserAddress, setClipboard } = tbcc.tb;
const { dateFormatter } = tbcc.utils;
const { PRIZE_TYPE_MAP, PRIZE_DRAW_STATUS_MAP } = tbcc.constants;
let flag = false;
......@@ -43,16 +45,13 @@ Page({
// 到期时间
getEndTime(prizeList = []) {
if (!prizeList || !prizeList.length) return null
const endTime = prizeList[0].expiredTime
let endTime = prizeList[0].expiredTime
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({
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({
this.setData({
myPrizeList: data.list
})
console.log(data.list)
this.getEndTime(data.list)
}
if (type != 'noLoading') {
......@@ -99,7 +99,7 @@ Page({
const { activityId } = app;
const { item } = e.target.dataset;
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')
commonToast(res && res.message)
}) || {};
......@@ -128,13 +128,13 @@ Page({
activityId,
name,
phone: telNumber,
addressdetail: detailInfo,
addressDetail: detailInfo,
cityCode,
city: cityName,
provice: provinceName,
area: countyName,
streetName,
id: item._id
id: item._id || item.id
}
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' }) => {
if (!cloud) {
......@@ -32,7 +32,7 @@ const request = ({ cloud, cloudName, requestType = 'cloud' }) => {
return new Promise((resolve, reject) => {
my.request({
url: AMS_URL + _cloudName + '.' + handle,
method,
method: "GET",
data: params,
dataType: 'json'
}).then(({ data: res }) => {
......@@ -69,7 +69,6 @@ const request = ({ cloud, cloudName, requestType = 'cloud' }) => {
return requestType === 'ams' ? requestAms() : requestCloud();
};
};
export default request;
\ No newline at end of file
......@@ -520,8 +520,8 @@ export const textRiskIdentification = async (text) => {
}
// 剪切板
export function setClipboard(params) {
return promisifyMyApi('setClipboard', params)
export const setClipboard = async (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