Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
M
mini-program-wepy
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
ui
mini-program-wepy
Commits
b7bb886d
Commit
b7bb886d
authored
May 26, 2020
by
ziyu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
improvement: 优化
parent
f4d6e876
Changes
9
Show whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
83 additions
and
82 deletions
+83
-82
app.wpy
src/app.wpy
+0
-1
openAnimation.wpy
src/components/custom/openAnimation.wpy
+9
-3
popup.wpy
src/components/custom/popup.wpy
+3
-3
awards.wpy
src/pages/awards.wpy
+0
-13
feedback.wpy
src/pages/feedback.wpy
+0
-13
index.wpy
src/pages/index.wpy
+4
-3
myraffles.wpy
src/pages/myraffles.wpy
+32
-37
prize.wpy
src/pages/prize.wpy
+32
-1
raffle.wpy
src/pages/raffle.wpy
+3
-8
No files found.
src/app.wpy
View file @
b7bb886d
...
@@ -76,7 +76,6 @@ wepy.app({
...
@@ -76,7 +76,6 @@ wepy.app({
'pages/myraffles',
'pages/myraffles',
'pages/help',
'pages/help',
'pages/morehelp',
'pages/morehelp',
'pages/awards',
],
],
window: {
window: {
backgroundTextStyle: 'light',
backgroundTextStyle: 'light',
...
...
src/components/custom/openAnimation.wpy
View file @
b7bb886d
...
@@ -40,7 +40,7 @@
...
@@ -40,7 +40,7 @@
</div>
</div>
<div class="dialog-footer">
<div class="dialog-footer">
<button class="btn" @tap="go">立即查看</button>
<button class="btn" @tap="go">立即查看</button>
<button class="btn" @tap="
go
">再次挑战</button>
<button class="btn" @tap="
hideAnimation
">再次挑战</button>
</div>
</div>
</div>
</div>
</div>
</div>
...
@@ -84,9 +84,15 @@
...
@@ -84,9 +84,15 @@
}, 500);
}, 500);
}, 2000);
}, 2000);
},
},
hideAnimation (){
this.showAnimation = false;
},
go() {
go() {
this.showAnimation = false;
this.showAnimation = false;
//如果得奖了走
wx.navigateTo({url:'/pages/prize'})
wx.navigateTo({url:'/pages/prize'})
//如果没得奖走
//wx.navigateTo({url:'/pages/myraffles'})
}
}
},
},
created() {
created() {
...
...
src/components/custom/popup.wpy
View file @
b7bb886d
...
@@ -20,8 +20,8 @@
...
@@ -20,8 +20,8 @@
},
},
data: {
data: {
menus: [
menus: [
{ img: '/static/images/awards@2x.png', title: '我的抽奖', path: '/pages/
award
s' },
{ img: '/static/images/awards@2x.png', title: '我的抽奖', path: '/pages/
myraffle
s' },
{ img: '/static/images/feedback@2x.png', title: '规则与帮助', path: '/pages/
feedback
' },
{ img: '/static/images/feedback@2x.png', title: '规则与帮助', path: '/pages/
help
' },
{ img: '/static/images/help@2x.png', title: '问题反馈', path: '/pages/help' }
{ img: '/static/images/help@2x.png', title: '问题反馈', path: '/pages/help' }
],
],
show: false,
show: false,
...
...
src/pages/awards.wpy
deleted
100644 → 0
View file @
f4d6e876
<style lang="less">
</style>
<template>
<view>我的抽奖</view>
</template>
<script>
import wepy from '@wepy/core';
wepy.page({
});
</script>
src/pages/feedback.wpy
deleted
100644 → 0
View file @
f4d6e876
<style lang="less">
</style>
<template>
<view>问题反馈</view>
</template>
<script>
import wepy from '@wepy/core';
wepy.page({
});
</script>
src/pages/index.wpy
View file @
b7bb886d
...
@@ -168,7 +168,6 @@
...
@@ -168,7 +168,6 @@
</wxs>
</wxs>
<template>
<template>
<view class="video-wrapper">
<view class="video-wrapper">
<van-dialog id="van-dialog" />
<view id="myvideo">
<view id="myvideo">
<van-notify id="van-notify" />
<van-notify id="van-notify" />
<video-list :videoList.sync="videoList" :total="total" bindchange="changeVideo">
<video-list :videoList.sync="videoList" :total="total" bindchange="changeVideo">
...
@@ -244,7 +243,6 @@
...
@@ -244,7 +243,6 @@
import store from '../store';
import store from '../store';
import { mapState, mapActions } from '@wepy/x';
import { mapState, mapActions } from '@wepy/x';
import wepy from '@wepy/core';
import wepy from '@wepy/core';
import Dialog from '../components/vant/dialog/dialog';
import Notify from '../components/vant/notify/notify';
import Notify from '../components/vant/notify/notify';
wepy.page({
wepy.page({
store,
store,
...
@@ -521,6 +519,10 @@
...
@@ -521,6 +519,10 @@
url: '/pages/raffle?id=1&progress=70&chance=1/780&corn=50000&imgsrc=/static/images/test2.png&goods=Nintendo Switch任天堂游戏机任天堂游戏机'
url: '/pages/raffle?id=1&progress=70&chance=1/780&corn=50000&imgsrc=/static/images/test2.png&goods=Nintendo Switch任天堂游戏机任天堂游戏机'
});
});
// this.awards = !this.awards;
// this.awards = !this.awards;
},
showMenu: function(v) {
console.log(v);
this.showMenus = v;
}
}
},
},
...
@@ -623,7 +625,6 @@
...
@@ -623,7 +625,6 @@
'van-button': '../components/vant/button/index',
'van-button': '../components/vant/button/index',
'video-list': '~@/components/custom/videolist',
'video-list': '~@/components/custom/videolist',
'van-icon': '../components/vant/icon/index',
'van-icon': '../components/vant/icon/index',
'van-dialog': '../components/vant/dialog/index',
'video-sign': '~@/components/custom/sign',
'video-sign': '~@/components/custom/sign',
'video-gold': '~@/components/custom/sign',
'video-gold': '~@/components/custom/sign',
'video-share': '~@/components/custom/sign',
'video-share': '~@/components/custom/sign',
...
...
src/pages/myraffles.wpy
View file @
b7bb886d
<style lang="less">
<style lang="less">
.raffles-list{
padding-bottom:30rpx;
}
.raffle-item{
.raffle-item{
background-color: #fff;
background-color: #fff;
padding:30rpx 0 0 30rpx;
padding:30rpx 0 0 30rpx;
...
@@ -63,45 +66,27 @@
...
@@ -63,45 +66,27 @@
}
}
}
}
</style>
</style>
<wxs module="prize">
function computClass (status) {
var cls=['','green','grey','','red','red'];
var index = status.value || 0;
console.log(status)
return cls[index]
};
module.exports = {
computClass:computClass
}
</wxs>
<template>
<template>
<view class="raffles-list">
<view class="raffles-list">
<view class="raffle-item">
<view class="raffle-item" wx:for="{{list}}" wx:key="index">
<image src="/static/images/test1.jpg" class="item-img"></image>
<image src="{{item.prize.photoUrl}}" class="item-img"></image>
<view class="item-right">
<view class="item-title">Nintendo Switch任天堂游戏机任天堂游戏机</view>
<view class="item-corn">花费: 500克币</view>
<view class="item-status">
<button class="item-button">领取</button>
</view>
</view>
</view>
<view class="raffle-item">
<image src="/static/images/test1.jpg" class="item-img"></image>
<view class="item-right">
<view class="item-right">
<view class="item-title">
Nintendo Switch任天堂游戏机任天堂游戏机
</view>
<view class="item-title">
{{item.prize.name}}
</view>
<view class="item-corn">花费:
500
克币</view>
<view class="item-corn">花费:
{{item.quantity}}
克币</view>
<view class="item-status">
<view class="item-status">
<text class="grey">未中奖</text>
<button data-id="{{item.id}}" class="item-button" bindtap="goprize" v-if="item.status.value==3">领取</button>
</view>
<text class="{{prize.computClass(item.status)}}" v-else>{{item.status.name}}</text>
</view>
</view>
<view class="raffle-item">
<image src="/static/images/test1.jpg" class="item-img"></image>
<view class="item-right">
<view class="item-title">Nintendo Switch任天堂游戏机任天堂游戏机</view>
<view class="item-corn">花费: 500克币</view>
<view class="item-status">
<text class="red">已发货</text>
</view>
</view>
</view>
<view class="raffle-item">
<image src="/static/images/test1.jpg" class="item-img"></image>
<view class="item-right">
<view class="item-title">Nintendo Switch任天堂游戏机任天堂游戏机</view>
<view class="item-corn">花费: 500克币</view>
<view class="item-status">
<text class="green">待开奖</text>
</view>
</view>
</view>
</view>
</view>
</view>
...
@@ -114,10 +99,20 @@
...
@@ -114,10 +99,20 @@
list:[]
list:[]
},
},
methods: {
methods: {
goprize(event) {
let detail = event.$wx.currentTarget;
let id = detail.dataset.id || ''
wx.navigateTo({url:'/pages/prize?prizeid='+id});
}
},
},
onLoad (query) {
onLoad (query) {
this.list = [
{id:1,status:{name:'待开奖',value:1},quantity:500,prize:{name:'Nintendo Switch任天堂游戏机任天堂游戏机',photoUrl:'/static/images/test1.jpg'}},
{id:2,status:{name:'未中奖',value:2},quantity:200,prize:{name:'Nintendo Switch任天堂游戏机任天堂游戏机',photoUrl:'/static/images/test1.jpg'}},
{id:3,status:{name:'待领取',value:3},quantity:300,prize:{name:'Nintendo Switch任天堂游戏机任天堂游戏机',photoUrl:'/static/images/test1.jpg'}},
{id:4,status:{name:'未发货',value:4},quantity:400,prize:{name:'Nintendo Switch任天堂游戏机任天堂游戏机',photoUrl:'/static/images/test1.jpg'}},
{id:5,status:{name:'已发货',value:5},quantity:500,prize:{name:'Nintendo Switch任天堂游戏机任天堂游戏机',photoUrl:'/static/images/test1.jpg'}},
];
},
},
});
});
</script>
</script>
...
...
src/pages/prize.wpy
View file @
b7bb886d
...
@@ -58,6 +58,9 @@
...
@@ -58,6 +58,9 @@
font-size: 30rpx;
font-size: 30rpx;
}
}
}
}
.van-picker .van-picker__cancel,.van-picker .van-picker__confirm{
color:#FF5D15;
}
</style>
</style>
<template>
<template>
<view class="prize-wrapper">
<view class="prize-wrapper">
...
@@ -83,11 +86,14 @@
...
@@ -83,11 +86,14 @@
<view class="footer">
<view class="footer">
<button class="getprize" bindtap="goprize">领取</button>
<button class="getprize" bindtap="goprize">领取</button>
</view>
</view>
<van-dialog id="van-dialog" confirmButtonColor="#FF5D15"/>
<van-notify id="van-notify" />
</view>
</view>
</template>
</template>
<script>
<script>
import wepy from '@wepy/core';
import wepy from '@wepy/core';
import Dialog from '../components/vant/dialog/dialog';
import Dialog from '../components/vant/dialog/dialog';
import Notify from '../components/vant/notify/notify';
var area = require('../components/custom/china.js');
var area = require('../components/custom/china.js');
wepy.page({
wepy.page({
data: {
data: {
...
@@ -101,6 +107,29 @@
...
@@ -101,6 +107,29 @@
},
},
methods: {
methods: {
goprize() {
goprize() {
if(!this.name){
Notify({message: '请填写收货人', background:'#FF5D15'});
return;
}
if(!this.phone){
Notify({message: '请填写手机号码', background:'#FF5D15'});
return;
}
if(!this.city){
Notify({message: '请选择所在地区', background:'#FF5D15'});
return;
}
if(!this.address){
Notify({message: '请填写详细地址', background:'#FF5D15'});
return;
}
Dialog.alert({
title: '领取成功',
message: '您所领取的奖品我们将在3到5个工作日内寄出,请您耐心等待,感谢您的参与!',
}).then(() => {
wx.reLaunch({url:'/pages/index'})
// on confirm
});
console.log(this.name,this.phone,this.address);
console.log(this.name,this.phone,this.address);
},
},
onClose() {
onClose() {
...
@@ -132,7 +161,9 @@
...
@@ -132,7 +161,9 @@
"van-field": "../components/vant/field/index",
"van-field": "../components/vant/field/index",
"van-cell": "../components/vant/cell/index",
"van-cell": "../components/vant/cell/index",
"van-area": "../components/vant/area/index",
"van-area": "../components/vant/area/index",
"van-popup": "../components/vant/popup/index"
"van-popup": "../components/vant/popup/index",
'van-dialog': '../components/vant/dialog/index',
"van-notify": "../components/vant/notify/index"
}
}
}
}
</config>
</config>
src/pages/raffle.wpy
View file @
b7bb886d
...
@@ -157,20 +157,15 @@
...
@@ -157,20 +157,15 @@
let detail = e.$wx.detail || {};
let detail = e.$wx.detail || {};
//调用接口将加密数据传给后端,e.$wx.detail整体都传过去
//调用接口将加密数据传给后端,e.$wx.detail整体都传过去
//如果数据得到了就跳转
//如果数据得到了就跳转
console.log(detail,111)
if(detail.encryptedData) {
if(detail.encryptedData) {
Notify({message: '恭喜您参与成功!',background:'rgba(0,0,0,0.7)'})
Notify({message: '恭喜您参与成功!',background:'#FF5D15'})
}else {
}else {
Notify({message: '参与失败,请重新授权!',background:'
rgba(0,0,0,0.7)
'})
Notify({message: '参与失败,请重新授权!',background:'
#FF5D15
'})
}
}
},
},
joinin() {
joinin() {
if(!this.isCheck) {
if(!this.isCheck) {
Notify({message: '请先勾选协议!', background:'#999'})
Notify({message: '请先勾选协议!', background:'#FF5D15'})
/*Dialog.alert({
message: '请先勾选协议!',
})*/
}
}
}
}
},
},
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment