Commit 7a67b4a9 authored by wildfirecode13's avatar wildfirecode13

1

parent 7937ad81
module.exports = () => {
const data = {
"tmallCat.exchangeGoodList": require('./mock/miniTb/tmallCat.exchangeGoodList.json')
}
return data
}
\ No newline at end of file
{
"success": true,
"fuck":"1",
"data": {
"list": [
{
"hasStock": false,
"image": "Excepteur eiusmod sit dolor",
"name": "aliquip",
"code": "reprehenderit",
"type": 4112149.6368029267,
"_id": "2",
"value": 51585947.06940037,
"status": 2
},
{
"hasStock": false,
"image": "Excepteur eiusmod sit dolor",
"name": "aliquip",
"code": "reprehenderit",
"type": 4112149.6368029267,
"_id": "2",
"value": 51585947.06940037,
"status": 2
},
{
"hasStock": false,
"image": "Excepteur eiusmod sit dolor",
"name": "aliquip",
"code": "reprehenderit",
"type": 4112149.6368029267,
"_id": "1",
"value": 51585947.06940037,
"status": 1
}
],
"happyCoin": 56338398.29509869
}
}
\ No newline at end of file
......@@ -51,6 +51,16 @@ const apiList = {
handle:'recallInfo',
method:'get',
isShowLoading: false
},
exchangeGood:{
handle:'exchangeGood',
method:'get',
isShowLoading: false
},
exchangeGoodList:{
handle:'exchangeGoodList',
method:'get',
isShowLoading: false
}
};
......
{
"pages": [
"pages/pageshop/pageshop",
"pages/pagecanvas/pagecanvas",
"pages/index/index",
"pages/pageshop/pageshop",
"pages/myprize/myprize"
],
"window": {
......
.shop-page {
width: 100vw;
height: 100vh;
opacity: 1;
position: absolute;
top: 0;
left: 0;
overflow: hidden;
/* background: url('') no-repeat center top/cover; */
}
.shop-wrap {
width: 100%;
position: absolute;
bottom: 0;
top: 254rpx;
padding-left: 54rpx;
right:0;
overflow-x: auto;
}
.shop-list {
width: 100%;
height: auto;
/* background-color: black; */
display: flex;
flex-flow: row wrap;
align-content: flex-start;
}
.shop .shopbg {
width: 750rpx;
height: 1624rpx;
opacity: 1;
position: absolute;
transform-origin: 0rpx 0rpx 0rpx;
}
.shop .shopitem {
position: relative;
/* display: flex;
justify-content: center;
align-items: center; */
box-sizing: border-box;
width: 309rpx;
height: 324rpx;
opacity: 1;
margin: 0 30rpx 30rpx 0;
/* left: 54rpx;
top: 254rpx; */
}
.shop .shopitem .shopitem_bg2 {
width: 309rpx;
height: 324rpx;
opacity: 1;
position: absolute;
transform-origin: 0rpx 0rpx 0rpx;
}
.shop .shopitem .shopitem_bg1 {
width: 224rpx;
height: 161rpx;
opacity: 1;
left: 45rpx;
top: 29rpx;
position: absolute;
transform-origin: 0rpx 0rpx 0rpx;
}
.shop .shopitem .shopitem_disabledbtn {
width: 209rpx;
height: 60rpx;
opacity: 1;
left: 49rpx;
top: 241rpx;
position: absolute;
transform-origin: 0rpx 0rpx 0rpx;
}
.shop .shopitem .shopitem_buybtn {
width: 217rpx;
height: 68rpx;
opacity: 1;
left: 45rpx;
top: 237rpx;
position: absolute;
transform-origin: 0rpx 0rpx 0rpx;
}
.shop .shopitem .shopitem_txt {
pointer-events: none;
width: 88rpx;
/* height: 20rpx; */
opacity: 1;
left: 136rpx;
top: 261rpx;
position: absolute;
transform-origin: 0rpx 0rpx 0rpx;
font-size: 21.79723rpx;
color: #474543;
}
.shop .shopitem .shopitem_name {
width: 209rpx;
/* height: 23rpx; */
opacity: 1;
left: 51rpx;
top: 203rpx;
position: absolute;
transform-origin: 0rpx 0rpx 0rpx;
font-size: 20.12052rpx;
color: #474543;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.shop .shop_gold {
width: 98rpx;
height: 21rpx;
opacity: 1;
left: 348rpx;
top: 151rpx;
position: absolute;
transform-origin: 0rpx 0rpx 0rpx;
font-size: 23.47394rpx;
color: #7b644e;
}
.shop .shop_backbtn {
width: 67rpx;
height: 67rpx;
opacity: 1;
left: 48rpx;
top: 41rpx;
position: absolute;
transform-origin: 0rpx 0rpx 0rpx;
}
\ No newline at end of file
<view class="shop">
<view class="shop-page" style="{{{'background':`url(${resList['da6bc001-768a-4b1c-95af-a9a8853ef6f9'].url}) no-repeat center top/cover`}}}">
<label class="shop_gold">{{happyCoin}}</label>
<image a:if={{false}} class="shop_backbtn" src={{resList['bdab9777-8a4d-4659-ba23-66aaddb7fa5b'].url}} />
<view class="shop-wrap">
<view class="shop-list">
<!--<image class="shopbg" src={{resList['da6bc001-768a-4b1c-95af-a9a8853ef6f9'].url}} /> -->
<view class="shopitem" a:for="{{list}}">
<image class="shopitem_bg2" src={{resList['a5230993-3870-4a91-bdd1-ffc4782770d0'].url}} />
<image class="shopitem_bg1" src={{resList['dd4ee407-16e4-4cb7-9eba-365b33f466a3'].url}} />
<image onTap="handleClick" data-item="{{item}}" a:if="{{!item.exchanged}}" class="shopitem_buybtn" src={{resList['dd8ea96e-e33f-4f5d-b31f-29f332c3c867'].url}} />
<image a:if="{{item.exchanged}}" class="shopitem_disabledbtn" src={{resList['8d08152f-311a-446a-a15a-ff02ebed0139'].url}} />
<label a:if="{{!item.exchanged}}" class="shopitem_txt">101010</label>
<label class="shopitem_name">{{item.name}}</label>
</view>
</view>
</view>
</view>
</view>
\ No newline at end of file
'use strict';
import resList from '../../resconfig/resList';
Component({
props: {},
data: {
resList: resList
},
methods: {
handleClick(e) {
this.props.onHandleClick(e)
}
// onBtnClick() {
// console.log('onBtnClick');
// this.onModalClose();
// },
// onModalClose() {
// const { onModalClose } = this.props;
// onModalClose && onModalClose();
// console.log('onModalClose')
// }
}
});
\ No newline at end of file
{
"component": true,
"usingComponents": {}
}
\ No newline at end of file
......@@ -55,18 +55,18 @@ Page({
onReady() {
console.log('on ready')
var that = this;
setTimeout(() => {
var parameter = {
name: "selectcatModal"
}
var data = {
netName: "mine.showModal",
parameter
}
that.onMessage({
data: data
})
}, 1000)
// setTimeout(() => {
// var parameter = {
// name: "selectcatModal"
// }
// var data = {
// netName: "mine.showModal",
// parameter
// }
// that.onMessage({
// data: data
// })
// }, 1000)
//授权和登录先搞
// this.getAuth();
my.__onMessage__ = (e) => {
......
.shop-page {
width: 100vw;
height: 100vh;
opacity: 1;
position: absolute;
top: 0;
left: 0;
overflow: hidden;
/* background: url('') no-repeat center top/cover; */
}
.shop-wrap {
width: 100%;
position: absolute;
bottom: 0;
top: 254rpx;
padding-left: 54rpx;
right:0;
overflow-x: auto;
}
.shop-list {
width: 100%;
height: auto;
/* background-color: black; */
display: flex;
flex-flow: row wrap;
align-content: flex-start;
}
.shop .shopbg {
width: 750rpx;
height: 1624rpx;
opacity: 1;
position: absolute;
transform-origin: 0rpx 0rpx 0rpx;
}
.shop .shopitem {
position: relative;
/* display: flex;
justify-content: center;
align-items: center; */
box-sizing: border-box;
width: 309rpx;
height: 324rpx;
opacity: 1;
margin: 0 30rpx 30rpx 0;
/* left: 54rpx;
top: 254rpx; */
}
.shop .shopitem .shopitem_bg2 {
width: 309rpx;
height: 324rpx;
opacity: 1;
position: absolute;
transform-origin: 0rpx 0rpx 0rpx;
}
.shop .shopitem .shopitem_bg1 {
width: 224rpx;
height: 161rpx;
opacity: 1;
left: 45rpx;
top: 29rpx;
position: absolute;
transform-origin: 0rpx 0rpx 0rpx;
}
.shop .shopitem .shopitem_disabledbtn {
width: 209rpx;
height: 60rpx;
opacity: 1;
left: 49rpx;
top: 241rpx;
position: absolute;
transform-origin: 0rpx 0rpx 0rpx;
}
.shop .shopitem .shopitem_buybtn {
width: 217rpx;
height: 68rpx;
opacity: 1;
left: 45rpx;
top: 237rpx;
position: absolute;
transform-origin: 0rpx 0rpx 0rpx;
}
.shop .shopitem .shopitem_txt {
width: 88rpx;
height: 20rpx;
opacity: 1;
left: 136rpx;
top: 261rpx;
position: absolute;
transform-origin: 0rpx 0rpx 0rpx;
font-size: 21.79723rpx;
color: #474543;
}
.shop .shopitem .shopitem_name {
width: 209rpx;
height: 23rpx;
opacity: 1;
left: 51rpx;
top: 203rpx;
position: absolute;
transform-origin: 0rpx 0rpx 0rpx;
font-size: 20.12052rpx;
color: #474543;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.shop .shop_gold {
width: 98rpx;
height: 21rpx;
opacity: 1;
left: 348rpx;
top: 151rpx;
position: absolute;
transform-origin: 0rpx 0rpx 0rpx;
font-size: 23.47394rpx;
color: #7b644e;
}
.shop .shop_backbtn {
width: 67rpx;
height: 67rpx;
opacity: 1;
left: 48rpx;
top: 41rpx;
position: absolute;
transform-origin: 0rpx 0rpx 0rpx;
}
\ No newline at end of file
<view class="shop">
<view class="shop-page" style="{{{'background':`url(${resList['da6bc001-768a-4b1c-95af-a9a8853ef6f9'].url}) no-repeat center top/cover`}}}">
<label class="shop_gold">101010</label>
<image a:if={{false}} class="shop_backbtn" src={{resList['bdab9777-8a4d-4659-ba23-66aaddb7fa5b'].url}} />
<view class="shop-wrap">
<view class="shop-list">
<!--<image class="shopbg" src={{resList['da6bc001-768a-4b1c-95af-a9a8853ef6f9'].url}} /> -->
<view class="shopitem" a:for="{{list}}">
<image class="shopitem_bg2" src={{resList['a5230993-3870-4a91-bdd1-ffc4782770d0'].url}} />
<image class="shopitem_bg1" src={{resList['dd4ee407-16e4-4cb7-9eba-365b33f466a3'].url}} />
<image class="shopitem_disabledbtn" src={{resList['8d08152f-311a-446a-a15a-ff02ebed0139'].url}} />
<image class="shopitem_buybtn" src={{resList['dd8ea96e-e33f-4f5d-b31f-29f332c3c867'].url}} />
<label class="shopitem_txt">101010</label>
<label class="shopitem_name">start{{item}}eeeeeeend</label>
</view>
</view>
</view>
</view>
<view class="fuck-shop">
<shop-modal
list ="{{list}}"
happyCoin ="{{happyCoin}}"
onHandleClick="handleClick" />
</view>
\ No newline at end of file
'use strict';
const EXCHANGE_STATUS = {
NO_EXCHANGE: 1,
DONE: 2
};
import resList from '../../resconfig/resList'; //import API from '../../api';
import API from '../../api';
let flag = 0;
Page({
data: {
list:[1,2,3,4,5]
list: [],
happyCoin: null
},
onLoad(props) {
this.setData( {
async onLoad(props) {
this.setData({
resList: resList
});
}
this.updateData();
},
async handleClick(e) {
if (flag) return;
flag = 1;
const { item:{_id} } = e.target.dataset;
const { success, data, message } = await API.exchangeGood({ _id }).catch(res => {
commonToast(res && res.message);
flag = 0;
}) || {};
flag = 0;
},
async onItemExchange(_id) {
const { success, data, message } = await API.exchangeGood({ _id }).catch(res => {
commonToast(res && res.message)
}) || {};
// API.exchangeGood({ _id })
// .then(() => {
// _list.forEach(item => {
// if (item._id == _id) {
// item.exchanged = true;
// }
// })
// console.log('_list', _list)
// this.setData({ list: [] });
// // this.updateData();
// })
// .catch(res => {
// });
},
async updateData() {
const { data: { list, happyCoin } } = await API.exchangeGoodList();
list.forEach(item => {
item.exchanged = item.status == EXCHANGE_STATUS.DONE;
});
this.setData({ list, happyCoin });
}
});
\ No newline at end of file
{
"usingComponents": {}
"usingComponents": {
"shop-modal": "/components/shopModal/shopModal"
}
}
\ No newline at end of file
......@@ -53,7 +53,8 @@ const request = ({ cloud, cloudName, requestType = 'cloud' }) => {
const requestMock = () => {
const mockUrlPrefix = {
ams: 'https://ams.dui88.com/server/index.php?g=Web&c=Mock&o=simple&projectID=218&uri=',
yapi: 'https://docs.dui88.com/mock/140/'
yapi: 'http://localhost:3000/'
// yapi: 'https://docs.dui88.com/mock/140/'
};
const mockUrl = null;
const requestPrefix = mockUrl || mockUrlPrefix[requestType];
......
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