luyisha 2 years ago
parent
commit
ce849ce052
  1. 5
      README.md
  2. 13
      node_modules/.package-lock.json
  3. 23
      package-lock.json
  4. 2
      package.json
  5. 2
      pages.json
  6. 2
      pages/about/bonusSet/bonusList.vue
  7. 4
      pages/about/bonusSet/bonusSet.vue
  8. 4
      pages/about/bonusSet/index.vue
  9. 114
      pages/home/home.vue
  10. 8
      pages/recordsList/recordsList.vue
  11. 232
      pages/scratchCard/scratchCard - jquery+h5.vue
  12. 196
      pages/scratchCard/scratchCard - uni丝滑.vue
  13. 231
      pages/scratchCard/scratchCard - 原本卡顿.vue
  14. 9
      pages/service/service.vue
  15. 13
      pages/ucenter/ucenter.vue

5
README.md

@ -1,3 +1,6 @@
<h2>
文档已移至 <a href="https://uniapp.dcloud.io/uniCloud/uni-starter.html" target="_blank">uni-starter文档</a>
</h2>
</h2>
// "echarts": "^5.4.3",无法在移动端使用Tooltip

13
node_modules/.package-lock.json

@ -1,13 +0,0 @@
{
"name": "ggjuni",
"version": "2.1.4",
"lockfileVersion": 2,
"requires": true,
"packages": {
"node_modules/qrcodejs2": {
"version": "0.0.2",
"resolved": "https://registry.npmjs.org/qrcodejs2/-/qrcodejs2-0.0.2.tgz",
"integrity": "sha512-+Y4HA+cb6qUzdgvI3KML8GYpMFwB24dFwzMkS/yXq6hwtUGNUnZQdUnksrV1XGMc2mid5ROw5SAuY9XhI3ValA=="
}
}
}

23
package-lock.json

@ -4,12 +4,11 @@
"requires": true,
"dependencies": {
"echarts": {
"version": "5.4.3",
"resolved": "https://registry.npmmirror.com/echarts/-/echarts-5.4.3.tgz",
"integrity": "sha512-mYKxLxhzy6zyTi/FaEbJMOZU1ULGEQHaeIeuMR5L+JnJTpz+YR03mnnpBhbR4+UYJAgiXgpyTVLffPAjOTLkZA==",
"version": "3.8.4",
"resolved": "https://registry.npmmirror.com/echarts/-/echarts-3.8.4.tgz",
"integrity": "sha512-4ZbiPnvehck63iqxTKdUNglcQPPCoYIvesBPAr/ncQoV9OO+aWds+d+bOcCiCdWqZfiOzQXo+FjjudMBcwmtgQ==",
"requires": {
"tslib": "2.3.0",
"zrender": "5.4.4"
"zrender": "3.7.3"
}
},
"qrcodejs2": {
@ -17,18 +16,10 @@
"resolved": "https://registry.npmjs.org/qrcodejs2/-/qrcodejs2-0.0.2.tgz",
"integrity": "sha512-+Y4HA+cb6qUzdgvI3KML8GYpMFwB24dFwzMkS/yXq6hwtUGNUnZQdUnksrV1XGMc2mid5ROw5SAuY9XhI3ValA=="
},
"tslib": {
"version": "2.3.0",
"resolved": "https://registry.npmmirror.com/tslib/-/tslib-2.3.0.tgz",
"integrity": "sha512-N82ooyxVNm6h1riLCoyS9e3fuJ3AMG2zIZs2Gd1ATcSFjSA23Q0fzjjZeh0jbJvWVDZ0cJT8yaNNaaXHzueNjg=="
},
"zrender": {
"version": "5.4.4",
"resolved": "https://registry.npmmirror.com/zrender/-/zrender-5.4.4.tgz",
"integrity": "sha512-0VxCNJ7AGOMCWeHVyTrGzUgrK4asT4ml9PEkeGirAkKNYXYzoPJCLvmyfdoOXcjTHPs10OZVMfD1Rwg16AZyYw==",
"requires": {
"tslib": "2.3.0"
}
"version": "3.7.3",
"resolved": "https://registry.npmmirror.com/zrender/-/zrender-3.7.3.tgz",
"integrity": "sha512-ujXpz/TW0IoVLp/ufOLbrrXQU9TZsxn5wTvINkWf8pHzUGmFkgh9bMUj0BteGgnJnNJDL0FxNV690P/y+rYJOg=="
}
}
}

2
package.json

@ -82,7 +82,7 @@
}
},
"dependencies": {
"echarts": "^5.4.3",
"echarts": "3.8.4",
"qrcodejs2": "^0.0.2"
}
}

2
pages.json

@ -322,7 +322,7 @@
}
,{
"path" : "pages/serivce/serivce",
"path" : "pages/service/service",
"style" :
{
"navigationBarTitleText": "联系客服",

2
pages/about/bonusSet/bonusList.vue

@ -81,6 +81,8 @@
})
this.amount = e.title.split('专区')[0];
this.id = e.id;
},
onShow() {
this.getList();
},
onReachBottom() {

4
pages/about/bonusSet/bonusSet.vue

@ -65,7 +65,7 @@
edit(val, i){
this.title = "编辑";
this.showEdit = true;
this.editInfo = val;
this.editInfo = {...val};
},
remove(val, i){
let _this = this;
@ -115,6 +115,8 @@
},
onLoad(e) {
this.id = e.id;
},
onShow() {
this.getList();
},
onNavigationBarButtonTap() {

4
pages/about/bonusSet/index.vue

@ -48,7 +48,7 @@
}
},
getList(){
API.request('/zone/zoneList', {}, res=>{
API.request('/adminZoneManage/zoneList', {}, res=>{
if(res.data.length<10){
this.noMore = true;
}
@ -60,7 +60,7 @@
}, fail=>{})
}
},
onLoad(e) {
onShow(e) {
this.getList();
},
onReachBottom() {

114
pages/home/home.vue

@ -32,14 +32,14 @@
<view class="list_area">
<view class="list_title">中奖记录</view>
<view class="dis-flex-between-center t-h">
<view class="">ID</view>
<view class="">手机号码</view>
<view class="">中奖金额</view>
<view class="" style="flex: 0.4;">ID</view>
<view class="" style="flex: 0.3;">手机号码</view>
<view class="" style="flex: 0.3;text-align: right;">中奖金额</view>
</view>
<view v-for="(item,index) in recordsList" :key="index" class="t-d dis-flex-between-center">
<view class="">{{item.user_id}}</view>
<view class="">{{item.phone}}</view>
<view class="black"><text class="red">{{item.awards_amount}}</text></view>
<view class="" style="flex: 0.4;">{{item.user_id}}</view>
<view class="" style="flex: 0.3;">{{item.phone}}</view>
<view class="black" style="flex: 0.3;text-align: right;"><text class="red">{{item.awards_amount}}</text></view>
</view>
</view>
</view>
@ -58,8 +58,9 @@
用户统计
</view>
<view class="pie_area">
<view class="pie_box" id="piechart">
<view class="pie_box" id="piechart"></view>
<view class="sum">
{{userStatistics.sum.num}}
</view>
<view class="right">
<view class="right1">
@ -185,8 +186,8 @@
},
onHide() {
if(this.userType=='user' && this.isPlay){
this.isPlay = false;
this.innerAudioContext.pause();
// this.isPlay = false;
// this.innerAudioContext.pause();
}
},
created() {
@ -196,6 +197,7 @@
if(this.userType=='user'){
this.innerAudioContext = uni.createInnerAudioContext();
this.innerAudioContext.autoplay = false;
this.innerAudioContext.loop = true;
this.innerAudioContext.src = '../../static/audio/bgm.mp3';
this.innerAudioContext.onPlay(() => {
console.log('开始播放');
@ -243,57 +245,75 @@
yMax = 200;
}
let interval = yMax / 5;
// yMax = interval*6;
if((interval+'-').indexOf('.')!=-1){
interval = Math.ceil(interval);
}
yMax = interval*5;
let option = {
color: ['#5087EC','#74C0C8'],
// title: {
// text: '',
// textStyle: {
// color: '#999',
// fontSize: 14,
// fontWeight: 'normal'
// }
// },
grid: {
top: '12%',
bottom: '12%',
left: '18%',
right: '5%'
bottom: '5%',
left: '2%',
right: '4%',
containLabel: true//
},
tooltip: {
trigger: 'axis',
triggerOn: 'mousemove|click'
},
tooltip: {},
xAxis: {
data: this.UpDownSta.xData,
axisLine: {
lineStyle: {
color: "#aaa",
width: 2
}
},
axisTick: {
lineStyle: {
color: "#aaa",
width: 2
}
},
axisLabel: {
color: '#444'
},
},
yAxis: [{
yAxis: {
type: 'value',
min: 0,
max: yMax,
interval: interval
interval: interval,
axisLine: {
show: false,
lineStyle: {
color: "#ddd"
}
},
axisLabel: {
color: '#444'
},
splitLine: {
lineStyle: {
color: "#ddd"
}
}
},
// {
// min: 0,
// max: yMax,
// interval: interval
// },
],
series: [
{
name: '',
type: 'bar',
barMaxWidth: 30,
data: this.UpDownSta.data
},
// {
// name: '',
// type: 'line',
// // data: [175, 180, 410, 208, 195, 330],
// data: this.UpDownSta.data,
// yAxisIndex: 1
// }
}
]
};
this.myChart.setOption(option);
this.myChart.dispatchAction({
type: 'showTip'
});
},
renderPie(){
let option = {
@ -407,6 +427,9 @@
this.page++;
this.getAwardRecords(this.page, 10);
}
},
onUnload(){
this.innerAudioContext.pause();
}
}
</script>
@ -581,12 +604,23 @@
}
.pie_area{
display: flex;
position: relative;
.pie_box{
width: 332rpx;height: 332rpx;
margin: 0px 20rpx 20rpx -20rpx;
box-sizing: border-box;
border: 10px solid #fff;
}
.sum{
position: absolute;top:0px;left:0px;
width: 332rpx;height: 332rpx;
line-height: 332rpx;
margin: 0px 20rpx 20rpx -20rpx;
text-align: center;
font-size: 18px;
font-weight: bold;
}
.right{
padding-top: 40rpx;
}

8
pages/recordsList/recordsList.vue

@ -3,10 +3,11 @@
<view class="nav_area"></view>
<view v-for="(item,index) in recordsList" :key="index" class="record-item">
<view class="record-item-top">
<view v-if="type=='XF'||type=='ZJ'">消费中奖记录</view>
<view v-if="type=='XF'">{{item.zone_title}}</view>
<view v-if="type=='ZJ'">{{item.zone_title}}</view>
<view v-if="type=='UP'||type=='DOWN'">ID{{item.id}}<text v-if="item.type">{{item.type}}</text></view>
<view v-if="type=='CZ'">{{item.trade_type}}</view>
<view v-if="type=='TX'">可提余额</view>
<view v-if="type=='TX'">{{item.trade_type}}</view>
<view class="" style="color: #CD2731;">
<!-- <text v-if="type=='CZ'||type=='ZJ'||type=='DOWN'">+</text>
<text v-else>-</text> -->
@ -92,6 +93,7 @@
amount1: item.withdrawal_amount,
amount2: item.withdrawal_balence,
time: item.apply_time,
trade_type: item.trade_type
}
});
if(this.page===1){
@ -159,6 +161,7 @@
amount1: item.actual_price,
amount2: item.residue_amount,
time: item.create_time,
zone_title: item.zone_title
}
});
if(this.page===1){
@ -186,6 +189,7 @@
amount1: item.awards_amount,
amount2: item.withdrawal_balance,
time: item.create_time,
zone_title: item.zone_title
}
});
if(this.page===1){

232
pages/scratchCard/scratchCard - jquery+h5.vue

@ -1,232 +0,0 @@
<template>
<view>
<view class="prizePage">
<!--游玩区域-->
<div class="box">
<p class="rule">活动规则</p>
<a href="../my.html" id="myWin">
<p class="my">我的奖品</p>
</a>
<div class="panel">
<canvas id="canvas" width="562" height="308" @touchstart="mousedown" @touchmove="mousemove" @touchend="mouseup"></canvas>
<div id="canvas-mask">
<a id="btn" href="javascript:;" @click="btnClick"></a>
<p>您今天还有<span id="change">3</span>次刮奖机会</p>
</div>
</div>
</div>
<!--游戏规则弹窗-->
<div id="mask-rule">
<div class="box-rule">
<span class="star"></span>
<h2>活动规则说明</h2>
<span id="close-rule"></span>
<div class="con">
<div class="text">
<p>活动规则说明活动规则说明活动规则说明活动规则说明活动规则说明活动规则说明</p>
<p>活动规则说明活动规则说明活动规则说明活动规则说明活动规则说明活动规则说明</p>
<p>活动规则说明活动规则说明活动规则说明活动规则说明活动规则说明活动规则说明</p>
<p>活动规则说明活动规则说明活动规则说明活动规则说明活动规则说明活动规则说明</p>
<p>活动规则说明活动规则说明活动规则说明活动规则说明活动规则说明活动规则说明</p>
<p>活动规则说明活动规则说明活动规则说明活动规则说明活动规则说明活动规则说明</p>
<p>活动规则说明活动规则说明活动规则说明活动规则说明活动规则说明活动规则说明</p>
<p>活动规则说明活动规则说明活动规则说明活动规则说明活动规则说明活动规则说明</p>
<p>活动规则说明活动规则说明活动规则说明活动规则说明活动规则说明活动规则说明</p>
<p>活动规则说明活动规则说明活动规则说明活动规则说明活动规则说明活动规则说明</p>
<p>活动规则说明活动规则说明活动规则说明活动规则说明活动规则说明活动规则说明</p>
<p>活动规则说明活动规则说明活动规则说明活动规则说明活动规则说明活动规则说明</p>
</div>
</div>
</div>
</div>
<!--中奖提示-->
<div id="mask">
<div class="blin"></div>
<div class="caidai"></div>
<div class="winning">
<div class="red-head"></div>
<div class="red-body"></div>
<div id="card">
<a href="" target="_self" class="win"></a>
</div>
<a href="" target="_self" class="btn"></a>
<span id="close"></span>
</div>
</div>
</view>
</view>
</template>
<script>
var $canvas = $("#canvas"),//canvas
clientWidth = document.documentElement.clientWidth,
canvasWidth = Math.floor(clientWidth * 562 / 750),//canvas = * 稿canvas / 750
canvasHeight = Math.floor(clientWidth * 308 / 750),//canvas = * 稿canvas / 750
ctx = $canvas[0].getContext("2d"),//canvas2d
$canvasMask = $("#canvas-mask"),//canvas
$btn = $("#btn"),//
$change = $("#change"),//
data = {count: 5},//
empty = false,
bool = false;//truefalse
export default {
data() {
return {
// w: 330,
// h: 280,
// isfinish:false,
// isClear:false,
// isWin: false,
// isThank: false
}
},
methods: {
init() {
$canvasMask.show();
$change.html(data.count);//
//canvas
$canvas.attr('width', canvasWidth);
$canvas.attr('height', canvasHeight);
//canvas
ctx.beginPath();
ctx.fillStyle = '#999';//
ctx.lineCap = "round";//线
ctx.lineJoin = "round";//线
ctx.lineWidth = 20;//
ctx.fillRect(0, 0, canvasWidth, canvasHeight);
ctx.closePath();
ctx.globalCompositeOperation = 'destination-out';//
//3destination-out
$canvas.css("display", "none");
$canvas.outerHeight();
$canvas.css("display", "inherit");
},
btnClick () {//
if (data.count > 0) {
data.count--;//
$canvas.css("background-image", "url('../common/image/prize/prize2.png')");
$canvasMask.hide();
} else {
alert("没有次数了");
}
},
//
mousedown (e) {
e = e || window.event;
e.preventDefault();
if (typeof e.touches !== 'undefined') {
e = e.touches[0];//
}
var x = e.pageX - $(this).offset().left,
y = e.pageY - $(this).offset().top;
ctx.moveTo(x, y);
//touchmove
$canvas.on('touchmove', eventMove);
},
mousemove (e) {
e = e || window.event;
e.preventDefault();
if (typeof e.touches !== 'undefined') {
e = e.touches[0];
}
var x = e.pageX - $(this).offset().left,
y = e.pageY - $(this).offset().top;
ctx.lineTo(x, y);
ctx.stroke();
clear();
},
//
mouseup () {
},
clear() {
if (empty) return;
var data = ctx.getImageData(0, 0, canvasWidth, canvasHeight).data,//canvas
half = 0;
//length = canvasWidth * canvasHeight * 4rgbaa0~255
for (var i = 3, length = data.length; i < length; i += 4) {//rgba0i=3
data[i] === 0 && half++;//imageDatahalf1 PS:
}
//20%
if (half >= canvasWidth * canvasHeight * 0.2) {
ctx.clearRect(0, 0, canvasWidth, canvasHeight);//
empty = true;
win();//
}
},
},
onReady(e) {
this.init();
},
}
</script>
<style lang="scss" scoped>
.prizePage{
width: 750rpx;
height: 1506rpx;
background: url("../../static/home/prize-bg.png") no-repeat;
background-size: contain;
}
.gift {
width: 330px;
height: 280px;
background-color: #FFF1B9;
position: absolute;
left: 50%;
// top: 50%;
margin-left: -165px;
// margin-top: 174px;
}
.mask{
width: 100%;
height: 100%;
background-color: rgba(0, 0, 0, 0.2);
position: fixed;
top: 0px;
left: 0px;
z-index: 2;
}
.winPrize{
width: 375px;
height: 575px;
background-image: url("../../static/home/prize.png");
background-size: contain;
position: fixed;
top: 50%;
left: 50%;
z-index: 3;
transform: translate(-50%, -50%);
text-align: center;
line-height: 550px;
color: #FFF1B9;
font-weight: bold;
font-size: 60px;
animation: showPrize 1s ease-in-out;
.close{
width: 50px;
height: 50px;
background-image: url("../../static/home/close.png");
background-size: contain;
position: fixed;
left: 50%;
transform: translate(-50%, -50%);
z-index: 4;
}
}
@keyframes showPrize {
0%{
transform: translate(-50%, -50%) scale(0.4);
}
100%{
transform: translate(-50%, -50%) scale(1);
}
}
</style>

196
pages/scratchCard/scratchCard - uni丝滑.vue

@ -1,196 +0,0 @@
<template>
<!-- 刮奖 -->
<view v-else class="scratch">
<view class="box">
<!-- 刮奖结果图片 -->
<image src="../../static/home/tem11.png" class="img"></image>
<!-- 刮奖canvas容器 -->
<canvas
class="canvas-box"
canvas-id="canvas-id"
:disable-scroll="true"
@touchstart="touchStart"
@touchmove="touchMove"
@touchend="touchEnd"
></canvas>
<!-- 刮奖前提示消息开始刮奖后隐藏 -->
<cover-view class="tip" v-if="!toDraw">
<cover-view class="text">
<cover-view class="text-tip">你还有</cover-view>
<cover-view class="light">1</cover-view>
<cover-view class="text-tip">次刮奖机会</cover-view>
</cover-view>
<!-- 开始刮奖按钮 -->
<cover-view class="btn" @tap="scratchStart()">
<cover-view class="text">立即刮奖</cover-view>
</cover-view>
</cover-view>
<!-- 如果后端没有不中奖的图则不中奖时默认显示 -->
<!-- <view v-if="hasDraw" class="award-box">
<text class="text">谢谢参与</text>
</view> -->
</view>
</view>
</template>
<script>
import Scratch from './scratch.js'
export default {
data () {
return {
// domain: getApp().globalData.baseUrl, //
toDraw: false, //
showResult: false, //
isWin: true, //
scratchWidth: 350, //
scratchHeight: 150, //
scratchSize: 10, //
scratchScale: 0.25, //
prize_img: '', //
isScratching: false ,// ,
}
},
methods: {
initCanvas () {
// onReadyh5onLoad
new Scratch(this, {
canvasId: 'canvas-id',
width: this.scratchWidth,
height: this.scratchHeight,
size: this.scratchSize,
scale: this.scratchScale
})
},
//
doPrizeScratchTicketFun () {
if (this.isScratching) return false
this.isScratching = true
//
this.$api.luckDraw
.doPrizeScratchTicket()
.then(res => {
this.prize_img = res.luckyPrize.prize_img
this.luckyPrize = res.luckyPrize
this.isWin = true
if (this.luckyPrize.is_winning === 2) this.isWin = false
this.isScratching = false
})
.catch(() => {
this.isScratching = false
},
//
scratchStart () {
this.toDraw = true
this.initCanvas()
this.doPrizeScratchTicketFun()
}
}
}
</script>
<style lang="scss">
.scratch {
width: 670upx;
height: 320upx;
background: url("../../static/home/tem11.png") no-repeat;
background-size: contain;
margin: 366upx auto 80upx;
padding: 29upx 25upx 21upx;
box-sizing: border-box;
position: relative;
overflow: hidden;
.box {
width: 100%;
height: 100%;
background: #ccc;
border-radius: 20upx;
position: relative;
overflow: hidden;
.img {
width: 100%;
height: 100%;
position: absolute;
top: 0;
left: 0;
}
.canvas-box {
position: absolute;
top: 0;
left: 0;
width: 100.5%;
height: 100%;
border-radius: 20upx;
overflow: hidden;
}
.tip {
position: absolute;
left: 0;
right: 0;
width: 100%;
height: 100%;
z-index: 999;
text-align: center;
.text {
font-size: 30upx;
font-weight: bold;
color: #444;
margin-top: 69upx;
.text-tip {
display: inline-block;
vertical-align: middle;
}
.light {
// color: $red;
display: inline-block;
vertical-align: middle;
margin: 0 6upx !important;
}
}
.btn {
width: 360upx;
height: 82upx;
border: none;
border-radius: 41upx;
margin: 59upx auto 0;
position: relative;
background: none;
background: #000;
.btn-img {
border: none;
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
}
.text {
display: inline;
position: absolute;
text-align: center;
color: #fff;
font-size: 30upx;
font-weight: bold;
margin: 0;
left: 50%;
top: 50%;
transform: translate(-50%, -50%);
}
}
}
.award-box {
width: 100%;
height: 100%;
border-radius: 20upx;
text-align: center;
line-height: 270upx;
background: #FFF1B9;
.text {
font-size: 40upx;
font-weight: bold;
color: #444;
}
}
}
}
</style>

231
pages/scratchCard/scratchCard - 原本卡顿.vue

@ -1,231 +0,0 @@
<template>
<view>
<view class="prizePage">
<view class="">
</view>
<view class="" style="position: relative;padding-top: 380px;width: 330px;margin: 0px auto;">
<div id="gift" class="gift"></div>
<canvas canvas-id="guagua" id="guagua" @touchstart="start" @touchend="end" @touchmove="move"
style="width: 330px;height: 280px;"></canvas>
</view>
<view class="mask" v-if="isWin || isThank">
</view>
<view class="winPrize" v-if="isWin">
20
<view class="close" @click="isWin = false"></view>
</view>
<view class="noPrize" v-if="isThank">
</view>
</view>
</view>
</template>
<script>
var ctx;
var sx = 0,
sy = 0,
perNum = 0;
var giftWidth=0,giftHeight=0;
var canvasId = "guagua";
export default {
data() {
return {
w: 330,
h: 280,
isfinish:false,
isClear:false,
isWin: false,
isThank: false
}
},
methods: {
giftWidth:function(){
const query = uni.createSelectorQuery().in(this);
query.select('#gift').boundingClientRect(data => {
giftWidth=data.width;
giftHeight=data.height;
}).exec();
},
finish:function(){
this.isfinish=true;
},
done:function(){
if(1){
this.isWin = true;
}else{
this.isThank = true;
}
},
start: function(e) {
if(this.isfinish){
if(!this.isClear){
this.isClear=true;
this.done();
ctx.moveTo(0, 0);
ctx.clearRect(0,0, 330, 280);
ctx.stroke()
ctx.draw(true);
}
return false;
}
sx = e.touches[0].x;
sy = e.touches[0].y;
ctx.moveTo(sx, sy);
console.log(e.touches[0].x + " " + e.touches[0].y)
// this.getFilledPercentage();
},
end: function(e) {
if(this.isfinish) return false;
},
move: function(e) {
e = e || window.event;
e.preventDefault();
if(this.isfinish){
if(!this.isClear){
this.isClear=true;
this.done();
ctx.moveTo(0, 0);
ctx.clearRect(0,0, 330, 280);
ctx.stroke()
ctx.draw(true);
}
return false;
}
ctx.lineTo(sx, sy);
ctx.moveTo(sx, sy);
// ctx.clearRect(sx-10, sy-10, 20, 20)
ctx.stroke()
// ctx.globalAlpha = 0;
ctx.draw(true);
this.getFilledPercentage();
sx = e.touches[0].x;
sy = e.touches[0].y;
},
createCtx: function() {
ctx = uni.createCanvasContext(canvasId);
this.createRect();
},
createRect: function() {
ctx.setFillStyle('#646464');
ctx.fillStyle = '#999';//
ctx.lineCap = "round";//线
ctx.lineJoin = "round";//线
ctx.lineWidth = 40;//
ctx.fillRect(0, 0, 330, 280);
// ctx.closePath();
ctx.globalCompositeOperation = 'destination-out';
ctx.draw(true)
},
getFilledPercentage: function() {
var that=this;
uni.canvasGetImageData({
canvasId: canvasId,
x: (that.w-giftWidth)/2-5,
y: (that.h-giftHeight)/2-5,
width: giftWidth,
height: giftHeight,
success: function(res) {
let pixels = res.data;
let transPixels = [];
for (let i = 0; i < pixels.length; i += 4) {
if (pixels[i + 3] < 128) {
transPixels.push(pixels[i + 3]);
}
}
perNum = (transPixels.length / (pixels.length / 4) * 100).toFixed(2);
if(perNum>=40){
console.log("finish");
that.finish();;
}
console.log(perNum)
}
});
}
},
onReady(e) {
this.createCtx();
this.giftWidth();
},
}
</script>
<style lang="scss" scoped>
.prizePage{
width: 750rpx;
height: 1506rpx;
background: url("../../static/home/prize-bg.png") no-repeat;
background-size: contain;
}
.gift {
width: 330px;
height: 280px;
background-color: #FFF1B9;
position: absolute;
left: 50%;
// top: 50%;
margin-left: -165px;
// margin-top: 174px;
}
.mask{
width: 100%;
height: 100%;
background-color: rgba(0, 0, 0, 0.2);
position: fixed;
top: 0px;
left: 0px;
z-index: 2;
}
.winPrize{
width: 375px;
height: 575px;
background-image: url("../../static/home/prize.png");
background-size: contain;
position: fixed;
top: 50%;
left: 50%;
z-index: 3;
transform: translate(-50%, -50%);
text-align: center;
line-height: 550px;
color: #FFF1B9;
font-weight: bold;
font-size: 60px;
animation: showPrize 1s ease-in-out;
.close{
width: 50px;
height: 50px;
background-image: url("../../static/home/close.png");
background-size: contain;
position: fixed;
left: 50%;
transform: translate(-50%, -50%);
z-index: 4;
}
}
@keyframes showPrize {
0%{
transform: translate(-50%, -50%) scale(0.4);
}
100%{
transform: translate(-50%, -50%) scale(1);
}
}
</style>

9
pages/serivce/serivce.vue → pages/service/service.vue

@ -42,7 +42,14 @@
})
},
getList(){
API.request('/user/getCustomerServiceList', {}, res=>{
let url = '';
if(uni.getStorageSync('userType')=='user'){
url = '/user/getCustomerServiceList'
}
if(uni.getStorageSync('userType')=='agent'){
url = '/agentTeam/getCustomerServiceList'
}
API.request(url, {}, res=>{
let list = res.data.list;
if(this.page===1){
list.length>0 ? this.noMore=false : false;

13
pages/ucenter/ucenter.vue

@ -208,7 +208,7 @@
[
{
"title": '在线客服',
"to": '/pages/serivce/serivce',
"to": '/pages/service/service',
"icon": "compose",
"iconN": "people"
},
@ -576,13 +576,12 @@
content:"确定后,将清除所有缓存数据",
success(res) {
if(res.confirm){
API.request('/adminUser/clean', {}, res=>{
uni.showToast({
title: res.msg
})
}, fail=>{})
}
// let tk = uni.getStorageSync('user_token');
// let ut = uni.getStorageSync('userType');
// uni.clearStorageSync();
// uni.setStorageSync('user_token', tk);
// uni.setStorageSync('userType', ut);
}
})
},

Loading…
Cancel
Save