提交 50a85aa6 作者: wk

积分兑换记录

父级 f71c6784
......@@ -72,6 +72,16 @@
color: #FF4D4F;
}
.image-add {
width: 40rpx;
height: 40rpx;
}
.line-grey {
height: 2rpx;
background-color: #F5F5F5;
}
.uni-blue-button {
height: 96rpx;
display: flex;
......
const $date = {
timeDiff(time, isBefore) {
var dateTime = new Date();
var end = new Date(time);
var dateDiff = 0
if (isBefore) {
dateDiff = dateTime.getTime() - end.getTime(); //时间差的毫秒数
} else {
dateDiff = end.getTime() - dateTime.getTime(); //时间差的毫秒数
}
if (dateDiff > 0) {
return this.formatDuring(dateDiff)
} else {
return "0秒"
}
},
formatDuring(mss) {
let days = Math.floor(mss / (1000 * 60 * 60 * 24));
let hours = Math.floor((mss % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60));
let minutes = Math.floor((mss % (1000 * 60 * 60)) / (1000 * 60));
let seconds = Math.round((mss % (1000 * 60)) / 1000);
if (days > 0) {
return days + "天" + hours + "小时" + minutes + "分钟" + seconds + "秒";
} else if (hours > 0) {
return hours + "小时" + minutes + "分钟" + seconds + "秒";
} else if (minutes > 0) {
return minutes + "分钟" + seconds + "秒";
} else if (seconds > 0) {
return seconds + "秒";
}
},
}
export default $date
......@@ -4,7 +4,7 @@
<view class="tabbar-item" v-for="(item,index) in tabList" :class="[item.centerItem ? 'center-item' : '']"
@click="changeItem(item)" :key="index">
<view class="item-top" :style="{padding: item.id == 2?0:'10rpx'}">
<image :src="tabId==item.id?item.selectIcon:item.icon" mode=""></image>
<image :src="tabId==item.id?item.selectIcon:item.icon"></image>
</view>
<view class="item-bottom" :class="[tabId==item.id ? 'item-active' : '']">
<text>{{item.text}}</text>
......@@ -173,8 +173,8 @@
.tabbar-container .center-item .item-top {
flex-shrink: 0;
width: 130rpx;
height: 130rpx;
width: 150rpx;
height: 150rpx;
position: absolute;
top: -50rpx;
/* left: calc(50% - 70rpx); */
......
......@@ -9,6 +9,8 @@ import $config from './common/config.js'
import $mta from "api/mta.js"
import $http from './api/request.js'
import $imageUtils from './common/imageUtils.js'
import $date from "./common/dateUtils.js"
Vue.prototype.$date = $date
Vue.prototype.$http = $http
Vue.prototype.$mta = $mta
Vue.prototype.$toast = $toast
......
......@@ -2,7 +2,7 @@
<view>
<view class="search-form-parent">
<view class="search-form">
<image src="../../static/search-icon.png" style="width: 40rpx;height: 40rpx;"></image>
<image src="../../../../static/search-icon.png" style="width: 40rpx;height: 40rpx;"></image>
<input placeholder="搜索人员" placeholder-class="search-placeholder" class="search-input" v-model="key"
@input="search" />
</view>
......@@ -28,7 +28,7 @@
</view>
<view class="user-item" v-else>{{user.user_name}}({{user.job_name||""}})</view>
<image
:src="selectIds.indexOf(user.user_id)!=-1?'../../static/cb-big-sel.png':'../../static/cb-big.png'"
:src="selectIds.indexOf(user.user_id)!=-1?'../../../../static/cb-big-sel.png':'../../../../static/cb-big.png'"
style="width: 48rpx;height: 48rpx;"></image>
</view>
</view>
......
......@@ -83,7 +83,8 @@
showed: 1,
app_endpoint: 2,
is_publish: 1,
app_sort: 1
app_sort: 1,
publish_target: "ydt"
},
orgName: "",
mostUsed: {},
......@@ -116,6 +117,8 @@
} else {
this.$toast.showToast(result.msg)
}
}, (err) => {
this.$toast.showToast(err.msg)
})
},
getOrgTree() {
......@@ -130,6 +133,8 @@
this.trees = result.data.list[0].children_list
this.orgName = uni.getStorageSync("org_name") || result.data.list[0].name
}
}, (err) => {
this.$toast.showToast(err.msg)
})
},
toChangeOrg() {
......@@ -177,6 +182,8 @@
} else {
this.$toast.showToast(result.msg)
}
}, (err) => {
this.$toast.showToast(err.msg)
})
},
toAlone(model, info) {
......@@ -223,6 +230,8 @@
} else {
this.$toast.showToast(result.msg)
}
}, (err) => {
this.$toast.showToast(err.msg)
})
},
getNeedDo() {
......@@ -235,6 +244,8 @@
}
}).then((result) => {
this.needDoCount = result.data.total_count
}, (err) => {
this.$toast.showToast(err.msg)
})
},
getAppGroup() {
......@@ -266,6 +277,8 @@
this.$toast.showToast(result.msg)
}
}
}, (err) => {
this.$toast.showToast(err.msg)
})
},
getAppList: function() {
......@@ -297,6 +310,8 @@
} else {
this.$toast.showToast(result.msg)
}
}, (err) => {
this.$toast.showToast(err.msg)
})
},
sortGroup: function(arr) {
......
......@@ -12,15 +12,15 @@
<view class="process-centent">
<view style="display: flex;flex-direction: row;align-items: center;" v-if="isShow">
<view class="text-black-normal" style="flex: 1;">请选择执行人</view>
<image src="../../static/add-ic.png" style="width: 40rpx;height: 40rpx;" @click="toSelectExecutor">
<image src="../../../static/add-ic.png" style="width: 40rpx;height: 40rpx;" @click="toSelectExecutor">
</image>
</view>
<view style="display: flex;flex-direction: row;flex-wrap: wrap;margin-top: 20rpx;">
<view v-for="(item,index) in executors" :key="index" :index="index" @click="clickItem(index)">
<view class="label-item">
<text>{{item.user_name}}</text>
<image src="../../static/close-btn.png" style="width: 40rpx;height: 40rpx;margin-left: 20rpx;"
@click="deleteExe(index)"></image>
<image src="../../../static/close-btn.png"
style="width: 40rpx;height: 40rpx;margin-left: 20rpx;" @click="deleteExe(index)"></image>
</view>
</view>
</view>
......@@ -29,15 +29,16 @@
<view class="process-notice-centent">
<view style="display: flex;flex-direction: row;align-items: center;">
<view class="text-black-normal" style="flex: 1;">请选择通知人</view>
<image src="../../static/add-ic.png" style="width: 40rpx;height: 40rpx;" @click="toSelectNotifier">
<image src="../../../static/add-ic.png" style="width: 40rpx;height: 40rpx;"
@click="toSelectNotifier">
</image>
</view>
<view style="display: flex;flex-direction: row;flex-wrap: wrap;margin-top: 20rpx;">
<view v-for="(item,index) in notifiers" :key="index" :index="index" @click="clickItem(index)">
<view class="label-item">
<text>{{item.user_name}}</text>
<image src="../../static/close-btn.png" style="width: 40rpx;height: 40rpx;margin-left: 20rpx;"
@click="deleteNot(index)"></image>
<image src="../../../static/close-btn.png"
style="width: 40rpx;height: 40rpx;margin-left: 20rpx;" @click="deleteNot(index)"></image>
</view>
</view>
</view>
......
......@@ -13,9 +13,7 @@
<view class="app-list">
<view class="menu-item" v-for="(item,index) in selList" :key="index">
<view class="logo-content">
<image
:src="item.ydt_logo"
class="logo"></image>
<image :src="item.ydt_logo" class="logo"></image>
<image src="../../../static/delete-ic.png" class="del" @click="toDel(index)"></image>
</view>
<view class="text">{{nameLengthDeal(item.app_name)}}</view>
......@@ -70,7 +68,8 @@
showed: 1,
app_endpoint: 2,
is_publish: 1,
app_sort: 1
app_sort: 1,
publish_target: "ydt"
},
}
},
......
......@@ -79,7 +79,16 @@
<image src="../../static/right-arrow.png" @click="toLinkScore"></image>
</view>
<view class="score-count">剩余:{{scoreDetail.integral||0}}积分</view>
<view class="record-content" v-if="changeRecords.length>0">
<!-- <image src="../../static/notice.png" style="width: 20rpx;height: 20rpx;"></image> -->
<swiper circular="true" :autoplay="true" class="swiper" :vertical="true">
<swiper-item v-for="(item,index) in changeRecords" :key="index" class="item">
<view class="record">
{{dealTimeDiff(item.created_at)}}{{item.ex_worker_name}}兑换了{{item.goods_name}}
</view>
</swiper-item>
</swiper>
</view>
<view class="list-content">
<view class="left-content">
<view class="item-content" v-for="(item,index) in leftList()" :key="index">
......@@ -145,7 +154,8 @@
role: "VISITOR",
nowTime: "",
project: {},
project_id: ""
project_id: "",
changeRecords: []
}
},
onLoad() {
......@@ -243,6 +253,7 @@
if (this.role == 'WORKER') {
this.getGoodsList()
this.getMyScore()
this.getChangeRecord()
}
})
},
......@@ -287,9 +298,21 @@
})
},
exchange(item) {
if (item.goods_integral > this.scoreDetail.integral) {
uni.showModal({
title: '提示',
content: `积分不足,无法兑换`,
showCancel: false,
confirmText: "知道了",
confirmColor: "#3B73FE",
success: (res) => {}
})
return
}
uni.showModal({
title: '提示',
content: `使用${item.goods_integral}积分兑换${item.goods_name}`,
confirmColor: "#3B73FE",
success: (res) => {
if (res.confirm) {
this.exchangeGood(item)
......@@ -306,11 +329,11 @@
},
// 兑换商品
exchangeGood(item) {
ScoreApi.exchangeGood({
Api.exchangeGood({
data: {
goods_id: item.goods_id,
worker_id: this.userInfo.worker.worker_id,
project_id: this.project.project_id,
worker_id: this.userInfo.worker.workerId,
project_id: this.project_id,
order_num: 1
}
}).then(res => {
......@@ -319,7 +342,10 @@
title: '兑换成功'
})
this.getMyScore()
this.getChangeRecord()
}
}, (err) => {
this.$toast.showToast(err.msg)
})
},
getBanners() {
......@@ -336,6 +362,8 @@
} else {
this.$toast.showToast(result.msg)
}
}, (err) => {
this.$toast.showToast(err.msg)
})
},
getNews() {
......@@ -352,6 +380,8 @@
} else {
this.$toast.showToast(result.msg)
}
}, (err) => {
this.$toast.showToast(err.msg)
})
},
//获取常用应用
......@@ -362,6 +392,8 @@
} else {
this.$toast.showToast(result.msg)
}
}, (err) => {
this.$toast.showToast(err.msg)
})
},
getRecentlyApp() {
......@@ -371,6 +403,8 @@
} else {
this.$toast.showToast(result.msg)
}
}, (err) => {
this.$toast.showToast(err.msg)
})
},
toLinkScore() {
......@@ -389,15 +423,41 @@
data: {
project_id: this.userInfo.worker.projectId,
worker_id: this.userInfo.worker.workerId,
time: date.getFullYear() + "-" + date.getMonth() + 1 + "-" + date.getDate()
time: date.getFullYear() + "-" + date.getMonth() + 1 + "-" + date.getDate(),
}
}).then(res => {
console.log("用户积分", res);
if (res.code === 0) {
this.scoreDetail = res.data
}
}, (err) => {
this.$toast.showToast(err.msg)
})
},
getChangeRecord() {
Api.getExchangeList({
data: {
project_id: this.project_id,
type: 1,
is_page: 1,
page: 1,
page_size: 10,
order: "desc"
}
}).then((result) => {
console.log("兑换记录", result);
if (result.code == 0) {
this.changeRecords = result.data.list
} else {
this.$toast.showToast(result.msg)
}
}, (err) => {
this.$toast.showToast(err.msg)
})
},
dealTimeDiff(startTime) {
return this.$date.timeDiff(startTime, true)
},
select(index) {
if (index == 0) {
this.isCommonSel = true
......@@ -425,6 +485,8 @@
} else {
this.$toast.showToast(result.msg)
}
}, (err) => {
this.$toast.showToast(err.msg)
})
},
isCompShow(comNo) {
......@@ -452,6 +514,7 @@
this.project_id = this.userInfo.worker.projectId
this.getGoodsList()
this.getMyScore()
this.getChangeRecord()
uni.setStorageSync("org_no", this.userInfo.user.org_no)
uni.setStorageSync("org_name", this.userInfo.currentProject.projectName)
this.city = this.userInfo.currentProject.city
......@@ -465,6 +528,8 @@
} else {
this.$toast.showToast(result.msg)
}
}, (err) => {
this.$toast.showToast(err.msg)
})
},
toLogin: function() {
......@@ -555,6 +620,8 @@
} else {
this.$toast.showToast(result.msg)
}
}, (err) => {
this.$toast.showToast(err.msg)
})
},
// 用户授权
......@@ -621,6 +688,8 @@
} else {
this.$toast.showToast(result.msg)
}
}, (err) => {
this.$toast.showToast(err.msg)
})
},
toAlone(model, info) {
......@@ -1106,6 +1175,33 @@
}
}
}
.record-content {
display: flex;
flex-direction: row;
.swiper {
height: 32px;
flex: 1;
.item {
display: flex;
flex-direction: row;
align-items: center;
.record {
font-family: "MicrosoftYaHeiUI";
font-weight: 400;
flex: 1;
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
font-size: 24rpx;
color: #FFAA44;
}
}
}
}
}
}
</style>
......@@ -11,7 +11,7 @@
</view>
<image :src="newDetail.articleImg" class="image"></image>
<view class="text-content">
<rich-text :nodes="newDetail.content"></rich-text>
<rich-text :nodes="newDetail.content" style="font-size: 28rpx;color: #333;"></rich-text>
</view>
</view>
<view class="other-content">
......
......@@ -101,6 +101,8 @@
} else {
this.$toast.showToast(result.msg)
}
}, (err) => {
this.$toast.showToast(err.msg)
})
},
departChange(e) {
......@@ -151,6 +153,8 @@
} else {
this.$toast.showToast(result.msg)
}
}, (err) => {
this.$toast.showToast(err.msg)
})
},
getPost() {
......@@ -167,6 +171,8 @@
} else {
this.$toast.showToast(result.msg)
}
}, (err) => {
this.$toast.showToast(err.msg)
})
}
}
......
......@@ -77,10 +77,13 @@
} else {
this.$toast.showToast(result.msg)
}
}, (err) => {
this.$toast.showToast(err.msg)
})
},
toNext() {
if (this.code == "") {
this.$toast.showToast("请输入邀请码")
return
}
uni.navigateTo({
......@@ -141,6 +144,8 @@
} else {
this.$toast.showToast(result.msg)
}
}, (err) => {
this.$toast.showToast(err.msg)
})
}
}
......
......@@ -92,7 +92,9 @@
if (code == 0) { //已绑定直接登录
this.directLogin()
} else if (code == 33199) { //未绑定 去绑定
this.showMadel()
uni.navigateTo({
url: "/pages/login/wxLogin/wxLogin"
})
} else { //其他错误
uni.showToast({
title: res.data.msg,
......
......@@ -68,6 +68,8 @@
} else {
this.$toast.showToast(result.msg)
}
}, (err) => {
this.$toast.showToast(err.msg)
})
},
authLogin() {
......@@ -148,6 +150,8 @@
icon: 'none'
})
}
}, (err) => {
this.$toast.showToast(err.msg)
})
},
showMadel: function() {
......@@ -191,6 +195,8 @@
url: "/pages/index/index"
})
}
}, (err) => {
this.$toast.showToast(err.msg)
})
},
directLogin: function() {
......@@ -218,6 +224,8 @@
icon: 'none'
})
}
}, (err) => {
this.$toast.showToast(err.msg)
})
},
login() {
......@@ -244,6 +252,8 @@
let result = res.data
console.log(result);
_this.unique_token = result.unique_token
}, (err) => {
this.$toast.showToast(err.msg)
})
},
});
......
......@@ -30,9 +30,7 @@
</template>
<script>
// import {
// ScoreApi
// } from '../../services/Score/index.js'
import Api from "../../../api/api.js"
export default {
data() {
return {
......@@ -49,15 +47,15 @@
}
},
onShow() { //监听页面显示
this.userInfo = uni.getStorageSync('userInfo')
this.project = uni.getStorageSync('userProject') || {}
this.userInfo = getApp().globalData.userInfo
this.project_id = this.userInfo.currentProject.projectId
let date = new Date()
let year = date.getFullYear()
let month = date.getMonth() + 1
let day = date.getDate()
this.requestParam.time = year + '-' + month + '-' + day
this.requestParam.worker_id = this.userInfo.worker_id
this.requestParam.project_id = this.project.project_id
this.requestParam.worker_id = this.userInfo.worker.workerId || ''
this.requestParam.project_id = this.project_id || ''
this.getScoreDetail() //暂时先注释掉02.16
// for(var i=0;i<100;i++){//历史明细假数据
// this.scoreDetail.listData.push({id:i+1,time:'2022-02-16',item_name:'csy'+(i+1),integral:i+1})
......@@ -72,7 +70,7 @@
},
// 获取积分数据
getScoreDetail() {
ScoreApi.getUserScore({
Api.getUserScore({
data: this.requestParam
}).then(res => {
if (res.code === 0) {
......@@ -124,7 +122,8 @@
display: flex;
justify-content: space-between;
align-items: center;
height: 104rpx;
padding: 30rpx;
border-radius: 30rpx;
position: relative;
border-bottom: 1px solid rgba($color: #999, $alpha: 0.5);
......
......@@ -6,8 +6,8 @@
<view class="info-content" :style="{top:statusBarHeight+45+'px'}">
<image src="../../static/mine-bg.png" class="image"></image>
<view class="company">{{currentJob.org_name||""}}</view>
<view class="name">{{userInfo.user.user_name}} {{currentJob.job_name}}</view>
<view class="project">{{currentJob.dept_name}}</view>
<view class="name">{{userInfo.user.user_name||""}} {{currentJob.job_name||""}}</view>
<view class="project">{{currentJob.dept_name||""}}</view>
<image src="../../static/avatar-def.png" class="avatar"></image>
</view>
</view>
......
......@@ -6,7 +6,7 @@
<view class="score-content" :style="{top:statusBarHeight+53+'px'}">
<image src="../../../static/ic-coin.png" class="image"></image>
<view class="score-count-content">
<view class="count">{{score}}</view>
<view class="count">{{scoreDetail.integral||0}}</view>
<view class="unit">积分</view>
</view>
<view class="history-content" @click="toHistory">
......@@ -25,25 +25,23 @@
<view class="list-content">
<view class="left-content">
<view class="item-content" v-for="(item,index) in leftList()" :key="index">
<image class="image"
src="https://img.alicdn.com/imgextra/i1/27493396/O1CN013NYTVu1axPeymS1yi_!!0-saturn_solar.jpg_468x468q75.jpg_.webp">
<image class="image" :src="item.goods_img">
</image>
<view class="count">500积分可兑换</view>
<view class="count">{{item.goods_integral}}积分可兑换</view>
<view class="name-content">
<view class="name">XXX牌雨伞XXX牌雨伞XXX牌雨伞XXX牌雨伞</view>
<image src="../../../static/exchange.png" class="image"></image>
<view class="name">{{item.goods_name}}</view>
<image src="../../../static/exchange.png" class="image" @click="exchange(item)"></image>
</view>
</view>
</view>
<view class="right-content">
<view class="item-content" v-for="(item,index) in rightList()" :key="index">
<image class="image"
src="https://bkimg.cdn.bcebos.com/pic/8718367adab44aedf44fb8c1b11c8701a18bfb96?x-bce-process=image/watermark,image_d2F0ZXIvYmFpa2U4MA==,g_7,xp_5,yp_5">
<image class="image" :src="item.goods_img">
</image>
<view class="count">500积分可兑换</view>
<view class="count">{{item.goods_integral}}积分可兑换</view>
<view class="name-content">
<view class="name">XXX牌雨伞XXX牌雨伞XXX牌雨伞XXX牌雨伞</view>
<image src="../../../static/exchange.png" class="image"></image>
<view class="name">{{item.goods_name}}</view>
<image src="../../../static/exchange.png" class="image" @click="exchange(item)"></image>
</view>
</view>
</view>
......@@ -76,15 +74,15 @@
onLoad(option) {
const info = uni.getSystemInfoSync()
this.statusBarHeight = info.statusBarHeight
this.userInfo = uni.getStorageSync('userInfo')
this.project = uni.getStorageSync('userProject') || {}
this.userInfo = getApp().globalData.userInfo
this.project_id = this.userInfo.currentProject.projectId
let date = new Date()
let year = date.getFullYear()
let month = date.getMonth() + 1
let day = date.getDate()
this.requestParam.time = year + '-' + month + '-' + day
this.requestParam.worker_id = this.userInfo.worker_id || ''
this.requestParam.project_id = this.project.project_id || ''
this.requestParam.worker_id = this.userInfo.worker.workerId || ''
this.requestParam.project_id = this.project_id || ''
this.getGoodsList()
this.getScoreDetail()
},
......@@ -92,22 +90,20 @@
getScoreDetail() {
var date = new Date()
Api.getUserScore({
data: {
project_id: getApp().globalData.userInfo.worker.projectId,
worker_id: getApp().globalData.userInfo.worker.workerId,
time: date.getFullYear() + "-" + date.getMonth() + 1 + "-" + date.getDate()
}
data: this.requestParam
}).then(res => {
if (res.code === 0) {
this.scoreDetail = res.data
}
}, (err) => {
this.$toast.showToast(err.msg)
})
},
getGoodsList() {
Api.getGoodsList({
data: {
is_page: 0,
project_id: getApp().globalData.userInfo.worker.projectId
project_id: this.project_id
}
}).then(res => {
if (res.code === 0) {
......@@ -125,6 +121,8 @@
}
})
}
}, (err) => {
this.$toast.showToast(err.msg)
})
},
toHistory() {
......@@ -150,6 +148,51 @@
}
return list
},
exchange(item) {
if (item.goods_integral > this.scoreDetail.integral) {
uni.showModal({
title: '提示',
content: `积分不足,无法兑换`,
showCancel: false,
confirmText: "知道了",
confirmColor: "#3B73FE",
success: (res) => {}
})
return
}
uni.showModal({
title: '提示',
content: `使用${item.goods_integral}积分兑换${item.goods_name}`,
confirmColor: "#3B73FE",
success: (res) => {
if (res.confirm) {
this.exchangeGood(item)
} else if (res.cancel) {
}
}
})
},
// 兑换商品
exchangeGood(item) {
Api.exchangeGood({
data: {
goods_id: item.goods_id,
worker_id: this.userInfo.worker.workerId,
project_id: this.project_id,
order_num: 1
}
}).then(res => {
if (res.code === 0) {
uni.showToast({
title: '兑换成功'
})
this.getScoreDetail()
}
}, (err) => {
this.$toast.showToast(err.msg)
})
},
}
}
</script>
......
......@@ -49,7 +49,7 @@
</view>
<view class="model-view" :style="showModal?'':'display:none;'">
<view class="model-out-box">
<view class="text-black-normal">{{curTitle}}</view>
<view class="text-black-normal" v-if="false">{{curTitle}}</view>
<view class="model-content">
<canvas canvas-id="qrcode" style="margin: 40rpx;"></canvas>
</view>
......

343 Bytes | W: | H:

1.1 KB | W: | H:

static/add-ic.png
static/add-ic.png
static/add-ic.png
static/add-ic.png
  • 2-up
  • Swipe
  • Onion skin
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
Please register or to comment