提交 5ab215f9 作者: wk

未来七天天气 登录接口调整 工地头条接口接入

父级 781cc1de
......@@ -23,6 +23,10 @@ const params = {
url: "/api/v1/system/p_user_third/get_wx_mini_program_openid",
method: "post"
},
authLogin: {
url: "/api/v1/system/p_user_third/user_third_bind",
method: "post"
},
// 注册
register: {
url: "/api/v1/access/login/user_register",
......@@ -38,6 +42,10 @@ const params = {
url: "/api/v1/config/code/get_codes_list",
method: "post"
},
sendCode: {
url: "/api/v1/access/login/create_validate_code",
method: "post"
},
//获取省市区
getAreaList: {
url: "/api/v1/base/area/get_area_box_list",
......@@ -122,12 +130,28 @@ const params = {
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",
url: "/ydt/api/v1/pageTemplate/getByTemplateKey",
method: "get"
},
getWeather: {
url: "/plat/api/v1/weather/get_weather",
method: "get"
},
getNewDetail: {
url: "/ydt/aArticleLibrary/getDetail",
method: "get"
},
uploadVisApp: {
url: "/ydt/api/v1/navigation/app_use/upload",
method: "post"
},
getNormalApp: {
url: "/ydt/api/v1/navigation/list",
method: "get"
},
getNearApp: {
url: "/ydt/api/v1/navigation/list/recently_used",
method: "get"
}
}
......
......@@ -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()
......
import Api from "./api.js"
async function $mta(menuName = '', routeUrl = '') {
console.log(menuName, routeUrl);
Api.uploadVisApp({
data: {
menuName: menuName,
routeUrl: routeUrl
}
}).then((result) => {
})
}
export default $mta
......@@ -6,6 +6,8 @@ import Vue from 'vue'
import tabBar from 'components/uni-tabbar/uni-tabbar.vue'
import $toast from './common/toast.js'
import $config from './common/config.js'
import $mta from "api/mta.js"
Vue.prototype.$mta = $mta
Vue.prototype.$toast = $toast
Vue.prototype.$config = $config
Vue.component('tabBar', tabBar)
......
......@@ -173,6 +173,14 @@
"navigationStyle": "custom"
}
}, {
"path": "pages/index/weather/weather",
"style": {
"navigationBarTitleText": "",
"enablePullDownRefresh": false,
"navigationStyle": "custom"
}
}
],
"globalStyle": {
......
<template>
<view style="display: flex;flex-direction: column;">
<navbar title="用户服务协议和隐私政策"></navbar>
<titleBar title="用户服务协议和隐私政策"></titleBar>
<view style="padding: 32rpx;display: flex;flex-direction: column;">
<text style="font-size: 32rpx;color: #333333;">
本协议是由您(以下简称“用户”)与本小程序系统(以下简称为“本小程序”)就本小程序提供的产品和服务内容,所订立的契约,具有合同的法律效力,请您仔细阅读。\n
......@@ -64,7 +64,7 @@
methods: {
toEnter() {
uni.redirectTo({
url: "/pages/enter-exit-page/enter-info-page"
url: "/pages/epidemic/recordInput/recordInput"
})
}
}
......
......@@ -3,21 +3,15 @@
<titleBar title="工地头条详情"></titleBar>
<view class="new-content">
<view class="title-content">
<text class="text">关于食堂发放免费午餐的消息通知</text>
<text class="text">{{dealTitle(newDetail.title) }}</text>
</view>
<view class="author-content">
<text class="text">张三 </text>
<text class="text" style="margin-left: 30rpx;">2022/12/14 16:52:56</text>
<text class="text">{{newDetail.updateUserName}}</text>
<text class="text" style="margin-left: 30rpx;">{{newDetail.articleTime}}</text>
</view>
<image src="https://img.redocn.com/sheying/20150804/gongdi_4770950.jpg" class="image"></image>
<view class="text-content">
<text class="text">描述内容
描述内容描述内容描述内容描述内容描述内容
描述内容描述内容描述内容描述内容描述内容描述
内容描述内容描述内容描述内容容描述内
描述内容描述内容描述内容描述内容描述内容
描述内容描述内容描述述内。
</text>
<text class="text">{{newDetail.content}}</text>
</view>
</view>
<view class="other-content">
......@@ -36,14 +30,43 @@
</template>
<script>
import Api from "../../../api/api.js"
export default {
data() {
return {
list: [{}]
list: [{}],
newDetail: {
title: "关于食堂发放免费午餐的消息通知息通知",
updateUserName: "张三",
articleTime: "2022/12/14 16:52:56",
content: "由于工人数量大、居住集中等原因,工地防疫一度是各地面对的难题。此前,不同地区都要求进工地的建筑工人或一天一检,或两天一检,比一般社会面更严格。工地上中老年人多。 在某东部省会工作的基层干部周楠曾负责协调、 监督一些工地与医院对接做核酸。 她注意到, 工地上有一些“ 50 后” 的农民工, 他们没有智能手机, 做核酸时无法扫码, 只能出示身份证。 "
},
id: ""
}
},
onLoad(options) {
this.id = options.id
},
methods: {
dealTitle(text) {
if (text.length > 15) {
return text.substr(0, 13) + "..."
}
return text
},
getNewDetail() {
Api.getNewDetail({
data: {
articleLibraryId: this.id
}
}).then((result) => {
if (result.code == 0) {
} else {
this.$toast.showToast(result.msg)
}
})
}
}
}
</script>
......
......@@ -8,8 +8,8 @@
<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 class="title">{{item.title}}</view>
<view class="user">{{item.updateUserName}} {{item.articleTime}}</view>
</view>
<image class="image" src="../../../static/banner.png"></image>
</view>
......@@ -22,19 +22,28 @@
export default {
data() {
return {
list: [{}],
list: [{
title: "关于食堂发放免费午餐的消息通知息通知",
updateUserName: "张三",
articleTime: "2022/12/14 16:52:56"
}],
page: 1,
pageSize: 20
pageSize: 20,
isHasMore: true
}
},
onLoad() {
// this.getNews()
},
onPullDownRefresh() {
this.page = 1
this.getNews()
},
onReachBottom() {
if (this.isHasMore) {
this.page++
this.getNews()
}
},
methods: {
toLinkDetail(item) {
......@@ -43,7 +52,7 @@
})
},
search(e) {
},
getNews() {
Api.getNews({
......@@ -51,10 +60,19 @@
pageNum: this.page,
pageSize: this.pageSize
}
}).then((res) => {
let result = res.data
}).then((result) => {
uni.stopPullDownRefresh()
if (result.code == 0) {
let list = result.data.list
if (list.length == this.pageSize) {
this.isHasMore = true
} else {
this.isHasMore = false
}
if (this.page == 1) {
this.list = []
}
this.list = this.list.concat(list)
} else {
this.$toast.showToast(result.msg)
}
......
<template>
<view class="content">
<titleBar title="未来7天天气"></titleBar>
<view class="weather-content">
<view class="weather-item" v-for="(item,index) in weather" :key="index">
<view class="date-content">
<view class="left">{{item.date}}</view>
<view class="right">{{item.week}}</view>
</view>
<view class="day-content">
<view class="left">白天:{{item.day.weather}}</view>
<view class="right">{{item.day.temphigh}}</view>
</view>
<view class="night-content">
<view class="left">夜间:{{item.night.weather}}</view>
<view class="right">{{item.night.templow}}</view>
</view>
</view>
</view>
</view>
</template>
<script>
export default {
data() {
return {
weather: []
}
},
onLoad(options) {
this.weather = JSON.parse(options.daily)
},
methods: {
}
}
</script>
<style lang="scss">
.content {
display: flex;
flex-direction: column;
.weather-content {
display: flex;
flex-direction: column;
.weather-item {
border-radius: 30rpx;
margin: 20rpx 30rpx 0 30rpx;
padding: 30rpx;
background: #fff;
box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
display: flex;
flex-direction: column;
.date-content {
display: flex;
flex-direction: row;
align-items: center;
.left {
color: #333;
font-size: 28rpx;
flex: 1;
}
.right {
color: #333;
font-size: 28rpx;
}
}
.day-content {
display: flex;
flex-direction: row;
align-items: center;
margin-top: 20rpx;
.left {
color: #333;
font-size: 28rpx;
flex: 1;
}
.right {
color: #333;
font-size: 28rpx;
}
}
.night-content {
display: flex;
flex-direction: row;
align-items: center;
margin-top: 20rpx;
.left {
color: #333;
font-size: 28rpx;
flex: 1;
}
.right {
color: #333;
font-size: 28rpx;
}
}
}
}
}
</style>
<template>
<view class="login-parent">
<titleBar title="微信绑定"></titleBar>
<view class="login-content">
<view class="login-logo" v-if="false">
<image src="../../static/logo.png"></image>
......@@ -40,8 +41,8 @@
},
methods: {
register: function() {
uni.redirectTo({
url: `../register/register?unique_token=${this.unique_token}&type=bind`
uni.navigateTo({
url: `/pages/login/register/register?unique_token=${this.unique_token}&type=bind`
})
},
bindLogin() {
......@@ -61,30 +62,25 @@
})
return
}
this.$http.consolePost({
url: "/api/v1/system/p_user_third/user_third_bind",
Api.authLogin({
data: {
"user_no": this.account,
"third_type": 1,
"unique_token": this.unique_token,
"password": this.password
}
}).then((res) => {
let result = res.data
"user_no": this.isQuick ? this.phone : this.account,
"third_type": 1
},
}).then((result) => {
console.log("登录用户信息:", result);
if (result.code === 0) {
uni.setStorageSync('isCanUse', false); //记录是否第一次授权 false:表示不是第一次授权
this.setToken(result.data.access_token)
uni.setStorageSync("short_token", result.data.short_token)
uni.setStorageSync("token", result.data.access_token)
uni.setStorageSync("user_info", result.data)
uni.setStorageSync("company_id", result.data.comp_id)
uni.setStorageSync("refresh_token", result.data.refresh_token)
uni.showToast({
title: "登录成功",
title: "授权登录成功",
icon: 'none'
})
uni.switchTab({
url: "../desk-page/desk-page"
url: "/pages/index/index"
})
} else {
uni.showToast({
......
......@@ -44,6 +44,7 @@
</template>
<script>
import Api from "../../../api/api.js"
export default {
data() {
return {
......@@ -91,20 +92,16 @@
})
return
}
this.$http.consolePost({
url: "/api/v1/access/login/create_validate_code",
Api.sendCode({
data: {
"phone": this.phone,
"usage_code": "1",
"template_no": "industry-0001",
"system_no": this.systemCode
"system_no": this.$config.systemCode
},
header: {
"Content-Type": "application/json"
}
}).then(function(res) {
}).then((res) => {
console.log(res);
let code = res.data.code
let code = res.code
if (code == 0) {
that.timeDown(that.downTime)
uni.showToast({
......@@ -113,11 +110,10 @@
})
} else {
uni.showToast({
title: res.data.msg,
title: res.msg,
icon: 'none'
})
}
})
},
timeDown(num) {
......@@ -185,18 +181,13 @@
get_key() {
// 先获取key 再登录
let that = this
this.$http.consolePost({
url: "/api/v1/access/access_system/get_key",
Api.getKey({
data: {
"system_no": this.$config.systemCode,
"auth_code": this.$config.authCode
},
header: {
"Content-Type": "application/json"
}
}).then((res) => {
console.log(res);
let result = res.data
}).then((result) => {
console.log(result);
if (result.code === 0) {
that.toLogin(result.data.key)
} else {
......@@ -212,30 +203,25 @@
title: "授权绑定中..."
})
let that = this
this.$http.consolePost({
url: "/api/v1/system/p_user_third/user_third_bind",
Api.authLogin({
data: {
"unique_token": this.unique_token,
"user_no": this.isQuick ? this.phone : this.account,
"third_type": 1
},
header: {
"Content-Type": "application/json"
}
}).then((res) => {
let result = res.data
}).then((result) => {
console.log("登录用户信息:", result);
if (result.code === 0) {
uni.setStorageSync('isCanUse', false); //记录是否第一次授权 false:表示不是第一次授权
uni.setStorageSync("short_token", result.data.short_token)
that.setToken(result.data.access_token)
uni.setStorageSync("token", result.data.access_token)
uni.setStorageSync("user_info", result.data)
uni.showToast({
title: "授权登录成功",
icon: 'none'
})
uni.switchTab({
url: "../desk-page/desk-page"
url:"/pages/index/index"
})
} else {
uni.showToast({
......@@ -251,8 +237,7 @@
})
let that = this
if (this.isQuick) {
this.$http.consolePost({
url: "/api/v1/access/login/do_login",
Api.login({
data: {
"phone": this.phone,
"code": this.code,
......@@ -263,12 +248,11 @@
"key": key,
"Content-Type": "application/json"
}
}).then((res) => {
let result = res.data
}).then((result) => {
console.log("登录用户信息:", result);
if (result.code === 0) {
uni.setStorageSync('isCanUse', false); //记录是否第一次授权 false:表示不是第一次授权
that.setToken(result.data.access_token)
uni.setStorageSync("token", result.data.access_token)
uni.setStorageSync("short_token", result.data.short_token)
uni.setStorageSync("user_info", result.data)
uni.setStorageSync("company_id", result.data.comp_id)
......@@ -281,11 +265,8 @@
this.toAuthLogin()
} else {
uni.switchTab({
url: "../index/index"
url: "/pages/index/index"
})
// uni.switchTab({
// url: "../index/index"
// })
}
} else {
uni.showToast({
......@@ -295,25 +276,23 @@
}
})
} else {
this.$http.consolePost({
url: "/api/v1/access/login/do_login",
Api.login({
data: {
"user_no": this.account,
"password": this.password,
"login_type": 1,
"system_no": this.systemCode
"system_no": this.$config.systemCode
},
header: {
"key": key,
"Content-Type": "application/json"
}
}).then((res) => {
let result = res.data
}).then((result) => {
console.log("登录用户信息:", result);
if (result.code === 0) {
uni.setStorageSync('isCanUse', false); //记录是否第一次授权 false:表示不是第一次授权
uni.setStorageSync("token", result.data.access_token)
uni.setStorageSync("short_token", result.data.short_token)
that.setToken(result.data.access_token)
uni.setStorageSync("user_info", result.data)
uni.setStorageSync("company_id", result.data.comp_id)
uni.setStorageSync("refresh_token", result.data.refresh_token)
......@@ -325,11 +304,8 @@
this.toAuthLogin()
} else {
uni.switchTab({
url: "../desk-page/desk-page"
url: "/pages/index/index"
})
// uni.switchTab({
// url: "../index/index"
// })
}
} else {
uni.showToast({
......
......@@ -156,7 +156,7 @@
if (result.code === 0) {
uni.setStorageSync('isCanUse', false); //记录是否第一次授权 false:表示不是第一次授权
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.setStorageSync("refresh_token", result.data.refresh_token)
......@@ -188,7 +188,7 @@
console.log("登录用户信息:", result);
if (result.code === 0) {
uni.setStorageSync('isCanUse', false); //记录是否第一次授权 false:表示不是第一次授权
this.setToken(result.data.access_token)
uni.setStorageSync("token", result.data.access_token)
uni.setStorageSync("short_token", result.data.short_token)
uni.setStorageSync("user_info", result.data)
uni.setStorageSync("company_id", result.data.comp_id)
......@@ -255,20 +255,16 @@
})
return
}
this.$http.consolePost({
url: "/api/v1/access/login/create_validate_code",
Api.sendCode({
data: {
"phone": this.phone,
"usage_code": "2",
"template_no": "industry-0001",
"system_no": this.$config.systemCode
},
header: {
"Content-Type": "application/json"
}
}).then(function(res) {
}).then((res) => {
console.log(res);
let code = res.data.code
let code = res.code
if (code == 0) {
that.timeDown(that.downTime)
uni.showToast({
......@@ -277,11 +273,10 @@
})
} else {
uni.showToast({
title: res.data.msg,
title: res.msg,
icon: 'none'
})
}
})
},
timeDown(num) {
......
......@@ -86,6 +86,7 @@
this.requestParam.worker_id = this.userInfo.worker_id || ''
this.requestParam.project_id = this.project.project_id || ''
this.getScoreDetail()
this.$mta("我的积分", "pages/mine/myScore/myScore")
},
methods: {
getScoreDetail() {
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
Please register or to comment