提交 781cc1de 作者: wk

我的积分 工地头条

父级 2a7f519c
<script>
export default {
globalData: {
userInfo: {}
},
onLaunch: function() {
console.log('App Launch')
},
......
......@@ -46,16 +46,16 @@ const params = {
/* 防疫模块*/
// 获取上一次填报记录
getBeforeRecord: {
url: "/score/api/v1/common_check/pass_code_record/detail",
url: "/plat/api/v1/common_check/pass_code_record/detail",
method: "get"
},
saveRecord: {
url: "/score/api/v1/common_check/pass_code_record/save",
url: "/plat/api/v1/common_check/pass_code_record/save",
method: "post"
},
//获取记录列表
getRecordList: {
url: "/score/api/v1/common_check/pass_code_record/list",
url: "/plat/api/v1/common_check/pass_code_record/list",
method: "get"
},
/* 加入组织 */
......@@ -113,6 +113,22 @@ const params = {
url: '/score/api/v1/labour/change_info_records',
method: 'get'
},
getUserInfo: {
url: "/ydt/api/v1/access/user/identity",
method: "get"
},
getNews: {
url: "/ydt/aArticleLibrary/getAArticleLibraryForm",
method: "get"
},
getHomeComp: {
url: "/api/v1/base/b_page_template/get_page_tpl_list?categ_no=one-point-mobile-page&useage=one-point-mobile-page",
method: "get"
},
getWeather: {
url: "/plat/api/v1/weather/get_weather",
method: "get"
}
}
export default buildParam(params)
......@@ -9,7 +9,7 @@ const http = (params) => {
data: params.data,
header: {
'access_token': uni.getStorageSync('token') || '',
"token": uni.getStorageSync('token') || ''
// "token": uni.getStorageSync('token') || ''
},
success(res) {
uni.hideLoading()
......
const $config = {
pwdTemplateNo: "SMS_166720076",
loginTemplateNo: "SMS_133860272",
systemCode: "college",
authCode: "494BBE85-A6AD-392F-5628-12B39F649333", //开发CED4DE04-BA74-81DF-E51E-9864E4FD0DCB 测试:494BBE85-A6AD-392F-5628-12B39F649333 正式:D0539533-E169-5338-8ED7-3FAD554F4F62
pwdTemplateNo: "industry-0001",
loginTemplateNo: "industry-0001",
systemCode: "industry",
authCode: "CED4DE04-BA74-81DF-E51E-9864E4FD0DCB", //开发CED4DE04-BA74-81DF-E51E-9864E4FD0DCB 测试:494BBE85-A6AD-392F-5628-12B39F649333 正式:D0539533-E169-5338-8ED7-3FAD554F4F62
pageSize: 20,
isPage: 1,
smsCfg: "college"
smsCfg: "industry"
}
export default $config
......@@ -50,7 +50,7 @@
"quickapp" : {},
/* 小程序特有相关 */
"mp-weixin" : {
"appid" : "",
"appid" : "wx3c46a41af47a9eb7",
"setting" : {
"urlCheck" : false
},
......
......@@ -141,21 +141,33 @@
"navigationStyle": "custom"
}
}
,{
"path" : "pages/login/createProject/createProject",
"style" :
{
}, {
"path": "pages/login/createProject/createProject",
"style": {
"navigationBarTitleText": "创建项目",
"enablePullDownRefresh": false,
"navigationStyle": "custom"
}
}, {
"path": "pages/mine/historyScore/historyScore",
"style": {
"navigationBarTitleText": "",
"enablePullDownRefresh": false,
"navigationStyle": "custom"
}
,{
"path" : "pages/mine/historyScore/historyScore",
"style" :
{
}, {
"path": "pages/index/siteNewList/siteNewList",
"style": {
"navigationBarTitleText": "",
"enablePullDownRefresh": true,
"navigationStyle": "custom"
}
}, {
"path": "pages/index/newDetail/newDetail",
"style": {
"navigationBarTitleText": "",
"enablePullDownRefresh": false,
"navigationStyle": "custom"
......
......@@ -6,15 +6,15 @@
<!-- 天气 -->
<view class="weather-content" :style="{top:statusBarHeight+36+'px'}">
<view class="temp-content">
<view class="temp">12</view>
<view class="weather">多云转晴</view>
<view class="temp">{{weather.temp}}</view>
<view class="weather">{{weather.weather}}</view>
</view>
<view class="line"></view>
<view class="login-info-content">
<view class="login-info">你好,欢迎登录</view>
<view class="login-info">{{userInfo.user_name||"您好"}},欢迎登录</view>
<view class="address-content">
<image src="../../static/loc.png" class="loc-image"></image>
<view class="address">浙江省杭州市西湖区</view>
<view class="address">{{address}}</view>
</view>
</view>
</view>
......@@ -24,7 +24,7 @@
<!-- </view> -->
</view>
<!-- 工地头条 -->
<view class=" top-new-content">
<view class=" top-new-content" @click="toLinkNew">
<image src="../../static/notice.png" class="image"></image>
<view class="title">工地头条</view>
<swiper circular="true" :autoplay="true" class="swiper" :vertical="true">
......@@ -71,40 +71,45 @@
<view class="score-content">
<view class="title-content">
<view class="title">积分兑换</view>
<view class="more">更多</view>
<image src="../../static/right-arrow.png"></image>
<view class="more" @click="toLinkScore">更多</view>
<image src="../../static/right-arrow.png" @click="toLinkScore"></image>
</view>
<view class="score-count">剩余:1000豆丁</view>
<view class="score-count">剩余:{{scoreDetail.integral||0}}积分</view>
<view class="list-content">
<view class="left-content">
<view class="item-content" v-for="(item,index) in leftList()" :key="index">
<image class="image"></image>
<view class="count">500豆丁可兑换</view>
<image class="image"
src="https://img.alicdn.com/imgextra/i1/27493396/O1CN013NYTVu1axPeymS1yi_!!0-saturn_solar.jpg_468x468q75.jpg_.webp">
</image>
<view class="count">500积分可兑换</view>
<view class="name-content">
<view class="name">XXX牌雨伞XXX牌雨伞XXX牌雨伞XXX牌雨伞</view>
<image src="../../static/exchange.png" class="image"></image>
<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"></image>
<view class="count">500豆丁可兑换</view>
<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>
<view class="count">500积分可兑换</view>
<view class="name-content">
<view class="name">XXX牌雨伞XXX牌雨伞XXX牌雨伞XXX牌雨伞</view>
<image src="../../static/exchange.png" class="image"></image>
<image src="../../static/exchange.png" class="image" @click="exchange(item)"></image>
</view>
</view>
</view>
</view>
</view>
<drag-ball x="300" y="350"></drag-ball>
<drag-ball x="300" y="450"></drag-ball>
<uni-tabbar currentPage="0"></uni-tabbar>
</view>
</template>
<script>
import qqmapsdk from "../../common/qqmap-wx-jssdk1.2/qqmap-wx-jssdk.js"
import Api from "../../api/api.js"
export default {
data() {
return {
......@@ -120,7 +125,15 @@
appList: [{}],
shopList: [{}, {}, {}],
isOrg: true,
news: ["关于食堂发放免费午餐的人员名单关于食堂发放免费午餐的人员名单", "新闻头条"]
news: ["关于食堂发放免费午餐的人员名单关于食堂发放免费午餐的人员名单", "新闻头条"],
scoreDetail: {},
city: "杭州市",
address: "浙江省杭州市西湖区",
weather: {
"weather": "\u5c0f\u96e8",
"temp": "4",
},
userInfo: {}
}
},
onLoad() {
......@@ -130,8 +143,75 @@
},
onShow() {
this.getSetting()
this.getMyScore()
},
methods: {
exchange(item) {
uni.showModal({
title: '提示',
content: `使用${item.goods_integral}积分兑换${item.goods_name}`,
success: (res) => {
if (res.confirm) {
this.exchangeGood(item)
} else if (res.cancel) {
}
}
})
},
// 兑换商品
exchangeGood(item) {
ScoreApi.exchangeGood({
data: {
goods_id: item.goods_id,
worker_id: this.userInfo.worker_id,
project_id: this.project.project_id,
order_num: 1
}
}).then(res => {
if (res.code === 0) {
uni.showToast({
title: '兑换成功'
})
this.getMyScore()
}
})
},
getNews() {
Api.getNews({
data: {
pageNum: this.page,
pageSize: this.pageSize
}
}).then((res) => {
let result = res.data
if (result.code == 0) {
this.news = result.data
} else {
this.$toast.showToast(result.msg)
}
})
},
toLinkScore() {
uni.navigateTo({
url: "/pages/mine/myScore/myScore"
})
},
toLinkNew() {
uni.navigateTo({
url: "/pages/index/siteNewList/siteNewList"
})
},
getMyScore() {
Api.getUserScore({
data: this.requestParam
}).then(res => {
console.log("用户积分", res);
if (res.code === 0) {
this.scoreDetail = res.data
}
})
},
select(index) {
if (index == 0) {
this.isCommonSel = true
......@@ -149,9 +229,11 @@
loginState() {
let that = this
uni.getStorage({
key: that.$config.authCode,
key: "token",
success(res) {
//获取用户信息
that.getUserInfo()
that.getNews()
},
fail() {
uni.showModal({
......@@ -170,6 +252,28 @@
}
})
},
getHomeComp() {
Api.getHomeComp().then((res) => {
let result = res.data
if (result.code == 0) {
} else {
this.$toast.showToast(result.msg)
}
})
},
getUserInfo() {
Api.getUserInfo().then((res) => {
let result = res.data
if (result.code == 0) {
getApp().globalData.userInfo = result.data
this.userInfo = result.data
this.title = "欢迎" + userInfo.user_name + "访问一点通"
} else {
this.$toast.showToast(result.msg)
}
})
},
toLogin: function() {
uni.navigateTo({
url: "/pages/login/login/login"
......@@ -232,7 +336,7 @@
//定位成功
console.log("当前位置", res.result.address);
that.address = res.result.address
that.$emit("change", that.index, that.address)
that.city = res.result.city
},
fail: function(res) {
console.log(res);
......@@ -246,6 +350,21 @@
}
})
},
getWeather() {
Api.getWeather({
data: {
type: 2,
city: this.city
}
}).then((res) => {
let result = res.data
if (result.code == 0) {
this.weather = result.data
} else {
this.$toast.showToast(result.msg)
}
})
},
// 用户授权
getAuthorize() {
const that = this
......
<template>
<view class="content">
<titleBar title="工地头条详情"></titleBar>
<view class="new-content">
<view class="title-content">
<text class="text">关于食堂发放免费午餐的消息通知</text>
</view>
<view class="author-content">
<text class="text">张三 </text>
<text class="text" style="margin-left: 30rpx;">2022/12/14 16:52:56</text>
</view>
<image src="https://img.redocn.com/sheying/20150804/gongdi_4770950.jpg" class="image"></image>
<view class="text-content">
<text class="text">描述内容
描述内容描述内容描述内容描述内容描述内容
描述内容描述内容描述内容描述内容描述内容描述
内容描述内容描述内容描述内容容描述内
描述内容描述内容描述内容描述内容描述内容
描述内容描述内容描述述内。
</text>
</view>
</view>
<view class="other-content">
<view class="title">其他头条</view>
<view class="list-content">
<view v-for="(item,index) in list" :key="index" class="list-item" @click="toLinkDetail(item)">
<view class="new-content">
<view class="title">关于食堂发放免费午餐的消息通知息通知</view>
<view class="user">张三 2022/12/14 16:52:56</view>
</view>
<image class="image" src="../../../static/banner.png"></image>
</view>
</view>
</view>
</view>
</template>
<script>
export default {
data() {
return {
list: [{}]
}
},
methods: {
}
}
</script>
<style lang="scss">
.content {
display: flex;
flex-direction: column;
.new-content {
margin: 30rpx;
display: flex;
flex-direction: column;
background-color: #FFFFFF;
border-radius: 30rpx;
.title-content {
display: flex;
padding: 30rpx;
flex-direction: column;
align-items: center;
text {
font-weight: 600;
font-size: 28rpx;
width: 420rpx;
text-align: center;
color: #333;
}
}
.author-content {
display: flex;
flex-direction: row;
margin-left: 30rpx;
text {
font-weight: 400;
font-size: 24rpx;
color: #999;
}
}
image {
width: 688rpx;
height: 230px;
margin-top: 30rpx;
}
.text-content {
display: flex;
flex-direction: column;
margin: 30rpx;
text {
font-weight: 400;
font-size: 28rpx;
color: #333;
letter-spacing: 0.02px;
}
}
}
.other-content {
display: flex;
flex-direction: column;
.title {
font-weight: 600;
font-size: 28rpx;
margin-left: 30rpx;
color: #333;
}
.list-content {
display: flex;
flex-direction: column;
.list-item {
width: 690rpx;
height: 86px;
// padding: 15px;
border-radius: 30rpx;
margin: 20rpx 30rpx 0 30rpx;
background: #fff;
box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
display: flex;
flex-direction: row;
.new-content {
display: flex;
width: 420rpx;
margin: 15px;
flex-direction: column;
.title {
font-weight: 600;
font-size: 28rpx;
color: #333;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
.user {
font-weight: 400;
font-size: 24rpx;
margin-top: 10rpx;
color: #999;
}
}
image {
width: 180rpx;
height: 56px;
margin-top: 15px;
border-radius: 10rpx;
}
}
}
}
}
</style>
<template>
<view class="content">
<titleBar title="工地头条"></titleBar>
<view class="search-content">
<image src="../../../static/ic-search.png" class="image"></image>
<input placeholder="搜索" placeholder-class="placeholderStyle" @input="search" class="inputStyle" />
</view>
<view class="list-content">
<view v-for="(item,index) in list" :key="index" class="list-item" @click="toLinkDetail(item)">
<view class="new-content">
<view class="title">关于食堂发放免费午餐的消息通知息通知</view>
<view class="user">张三 2022/12/14 16:52:56</view>
</view>
<image class="image" src="../../../static/banner.png"></image>
</view>
</view>
</view>
</template>
<script>
import Api from "../../../api/api.js"
export default {
data() {
return {
list: [{}],
page: 1,
pageSize: 20
}
},
onLoad() {
},
onPullDownRefresh() {
},
onReachBottom() {
},
methods: {
toLinkDetail(item) {
uni.navigateTo({
url: "/pages/index/newDetail/newDetail"
})
},
search(e) {
},
getNews() {
Api.getNews({
data: {
pageNum: this.page,
pageSize: this.pageSize
}
}).then((res) => {
let result = res.data
if (result.code == 0) {
} else {
this.$toast.showToast(result.msg)
}
})
}
}
}
</script>
<style lang="scss">
.content {
display: flex;
flex-direction: column;
.search-content {
display: flex;
flex-direction: row;
border: 1rpx solid #656565;
height: 30px;
margin: 30rpx;
width: 688rpx;
border-radius: 30rpx;
align-items: center;
image {
width: 24rpx;
margin-left: 30rpx;
height: 24rpx;
}
.placeholderStyle {
font-size: 24rpx;
color: #999;
}
.inputStyle {
font-size: 24rpx;
margin-left: 20rpx;
color: #333;
}
}
.list-content {
display: flex;
flex-direction: column;
.list-item {
width: 690rpx;
height: 86px;
// padding: 15px;
border-radius: 30rpx;
margin: 20rpx 30rpx 0 30rpx;
background: #fff;
box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
display: flex;
flex-direction: row;
.new-content {
display: flex;
width: 420rpx;
margin: 15px;
flex-direction: column;
.title {
font-weight: 600;
font-size: 28rpx;
color: #333;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
.user {
font-weight: 400;
font-size: 24rpx;
margin-top: 10rpx;
color: #999;
}
}
image {
width: 180rpx;
height: 56px;
margin-top: 15px;
border-radius: 10rpx;
}
}
}
}
</style>
......@@ -96,7 +96,7 @@
unique_token: this.unique_token
}
}).then((res) => {
let code = res.data.code
let code = res.code
if (code == 0) { //已绑定直接登录
this.directLogin()
} else if (code == 33199) { //未绑定 去绑定
......@@ -157,12 +157,11 @@
data: {
unique_token: this.unique_token
}
}).then((res) => {
let result = res.data
}).then((result) => {
console.log("登录用户信息:", result);
if (result.code == 0) {
uni.setStorageSync("short_token", result.data.short_token)
this.setToken(result.data.access_token)
uni.setStorageSync("token", result.data.access_token)
uni.setStorageSync("user_info", result.data)
uni.setStorageSync("company_id", result.data.comp_id)
uni.showToast({
......@@ -201,8 +200,9 @@
"Content-Type": "application/json"
}
}).then((res) => {
let result = res.data
console.log(result);
_this.unique_token = result.data.unique_token
_this.unique_token = result.unique_token
})
},
});
......
......@@ -43,7 +43,7 @@
<view class="btn-org">
<text class="text">切换组织</text>
</view>
<view class="btn-logout">
<view class="btn-logout" @click="toLinkLogin">
<text class="text">退出登录</text>
</view>
<uni-tabbar currentPage="3"></uni-tabbar>
......@@ -63,7 +63,11 @@
this.statusBarHeight = info.statusBarHeight
},
methods: {
toLinkLogin() {
uni.reLaunch({
url: "/pages/login/login/login"
})
}
}
}
</script>
......
......@@ -7,7 +7,7 @@
<image src="../../../static/ic-coin.png" class="image"></image>
<view class="score-count-content">
<view class="count">{{score}}</view>
<view class="unit">豆丁</view>
<view class="unit">积分</view>
</view>
<view class="history-content" @click="toHistory">
<text class="text">兑换历史</text>
......@@ -25,21 +25,25 @@
<view class="list-content">
<view class="left-content">
<view class="item-content" v-for="(item,index) in leftList()" :key="index">
<image class="image"></image>
<view class="count">{{item.goods_integral}}豆丁可兑换</view>
<image class="image"
src="https://img.alicdn.com/imgextra/i1/27493396/O1CN013NYTVu1axPeymS1yi_!!0-saturn_solar.jpg_468x468q75.jpg_.webp">
</image>
<view class="count">500积分可兑换</view>
<view class="name-content">
<view class="name">{{item.goods_name}}</view>
<image src="../../../static/exchange.png" class="image" v-if="item.percent==1"></image>
<view class="name">XXX牌雨伞XXX牌雨伞XXX牌雨伞XXX牌雨伞</view>
<image src="../../../static/exchange.png" class="image"></image>
</view>
</view>
</view>
<view class="right-content">
<view class="item-content" v-for="(item,index) in rightList()" :key="index">
<image class="image"></image>
<view class="count">{{item.goods_integral}}豆丁可兑换</view>
<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>
<view class="count">500积分可兑换</view>
<view class="name-content">
<view class="name">{{item.goods_name}}</view>
<image src="../../../static/exchange.png" class="image" v-if="item.percent==1"></image>
<view class="name">XXX牌雨伞XXX牌雨伞XXX牌雨伞XXX牌雨伞</view>
<image src="../../../static/exchange.png" class="image"></image>
</view>
</view>
</view>
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
Please register or to comment