提交 5ab215f9 作者: wk

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

父级 781cc1de
...@@ -23,6 +23,10 @@ const params = { ...@@ -23,6 +23,10 @@ const params = {
url: "/api/v1/system/p_user_third/get_wx_mini_program_openid", url: "/api/v1/system/p_user_third/get_wx_mini_program_openid",
method: "post" method: "post"
}, },
authLogin: {
url: "/api/v1/system/p_user_third/user_third_bind",
method: "post"
},
// 注册 // 注册
register: { register: {
url: "/api/v1/access/login/user_register", url: "/api/v1/access/login/user_register",
...@@ -38,6 +42,10 @@ const params = { ...@@ -38,6 +42,10 @@ const params = {
url: "/api/v1/config/code/get_codes_list", url: "/api/v1/config/code/get_codes_list",
method: "post" method: "post"
}, },
sendCode: {
url: "/api/v1/access/login/create_validate_code",
method: "post"
},
//获取省市区 //获取省市区
getAreaList: { getAreaList: {
url: "/api/v1/base/area/get_area_box_list", url: "/api/v1/base/area/get_area_box_list",
...@@ -122,12 +130,28 @@ const params = { ...@@ -122,12 +130,28 @@ const params = {
method: "get" method: "get"
}, },
getHomeComp: { 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" method: "get"
}, },
getWeather: { getWeather: {
url: "/plat/api/v1/weather/get_weather", url: "/plat/api/v1/weather/get_weather",
method: "get" 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) => { ...@@ -9,7 +9,7 @@ const http = (params) => {
data: params.data, data: params.data,
header: { header: {
'access_token': uni.getStorageSync('token') || '', 'access_token': uni.getStorageSync('token') || '',
// "token": uni.getStorageSync('token') || '' "token": uni.getStorageSync('token') || ''
}, },
success(res) { success(res) {
uni.hideLoading() 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' ...@@ -6,6 +6,8 @@ import Vue from 'vue'
import tabBar from 'components/uni-tabbar/uni-tabbar.vue' import tabBar from 'components/uni-tabbar/uni-tabbar.vue'
import $toast from './common/toast.js' import $toast from './common/toast.js'
import $config from './common/config.js' import $config from './common/config.js'
import $mta from "api/mta.js"
Vue.prototype.$mta = $mta
Vue.prototype.$toast = $toast Vue.prototype.$toast = $toast
Vue.prototype.$config = $config Vue.prototype.$config = $config
Vue.component('tabBar', tabBar) Vue.component('tabBar', tabBar)
......
...@@ -173,6 +173,14 @@ ...@@ -173,6 +173,14 @@
"navigationStyle": "custom" "navigationStyle": "custom"
} }
}, {
"path": "pages/index/weather/weather",
"style": {
"navigationBarTitleText": "",
"enablePullDownRefresh": false,
"navigationStyle": "custom"
}
} }
], ],
"globalStyle": { "globalStyle": {
......
<template> <template>
<view style="display: flex;flex-direction: column;"> <view style="display: flex;flex-direction: column;">
<navbar title="用户服务协议和隐私政策"></navbar> <titleBar title="用户服务协议和隐私政策"></titleBar>
<view style="padding: 32rpx;display: flex;flex-direction: column;"> <view style="padding: 32rpx;display: flex;flex-direction: column;">
<text style="font-size: 32rpx;color: #333333;"> <text style="font-size: 32rpx;color: #333333;">
本协议是由您(以下简称“用户”)与本小程序系统(以下简称为“本小程序”)就本小程序提供的产品和服务内容,所订立的契约,具有合同的法律效力,请您仔细阅读。\n 本协议是由您(以下简称“用户”)与本小程序系统(以下简称为“本小程序”)就本小程序提供的产品和服务内容,所订立的契约,具有合同的法律效力,请您仔细阅读。\n
...@@ -64,7 +64,7 @@ ...@@ -64,7 +64,7 @@
methods: { methods: {
toEnter() { toEnter() {
uni.redirectTo({ uni.redirectTo({
url: "/pages/enter-exit-page/enter-info-page" url: "/pages/epidemic/recordInput/recordInput"
}) })
} }
} }
......
...@@ -4,14 +4,14 @@ ...@@ -4,14 +4,14 @@
<image src="../../static/home-head.png" class="header-image"></image> <image src="../../static/home-head.png" class="header-image"></image>
<navbar :title="title" :showBack="false"></navbar> <navbar :title="title" :showBack="false"></navbar>
<!-- 天气 --> <!-- 天气 -->
<view class="weather-content" :style="{top:statusBarHeight+36+'px'}"> <view class="weather-content" :style="{top:statusBarHeight+36+'px'}" v-if="isCompShow('onepoint-weather')">
<view class="temp-content"> <view class="temp-content" @click="toLinkOther">
<view class="temp">{{weather.temp}}</view> <view class="temp">{{weather.temp}}</view>
<view class="weather">{{weather.weather}}</view> <view class="weather">{{weather.weather}}</view>
</view> </view>
<view class="line"></view> <view class="line"></view>
<view class="login-info-content"> <view class="login-info-content">
<view class="login-info">{{userInfo.user_name||"您好"}},欢迎登录</view> <view class="login-info">{{userInfo.user.user_name||"您好"}},欢迎登录</view>
<view class="address-content"> <view class="address-content">
<image src="../../static/loc.png" class="loc-image"></image> <image src="../../static/loc.png" class="loc-image"></image>
<view class="address">{{address}}</view> <view class="address">{{address}}</view>
...@@ -20,22 +20,22 @@ ...@@ -20,22 +20,22 @@
</view> </view>
<!-- <view class="banner-content" :style="{top:statusBarHeight+116+'px'}"> --> <!-- <view class="banner-content" :style="{top:statusBarHeight+116+'px'}"> -->
<ls-swiper :list="banners" imgKey="url" :loop="true" :dots='true' :autoplay='true' height='142' <ls-swiper :list="banners" imgKey="url" :loop="true" :dots='true' :autoplay='true' height='142'
@clickItem="clickItem()" /> @clickItem="clickItem()" v-if="isCompShow('OnePointBanner')" />
<!-- </view> --> <!-- </view> -->
</view> </view>
<!-- 工地头条 --> <!-- 工地头条 -->
<view class=" top-new-content" @click="toLinkNew"> <view class=" top-new-content" @click="toLinkNew" v-if="isCompShow('OnePointNews')">
<image src="../../static/notice.png" class="image"></image> <image src="../../static/notice.png" class="image"></image>
<view class="title">工地头条</view> <view class="title">工地头条</view>
<swiper circular="true" :autoplay="true" class="swiper" :vertical="true"> <swiper circular="true" :autoplay="true" class="swiper" :vertical="true">
<swiper-item v-for="(item,index) in news" :key="index" class="item"> <swiper-item v-for="(item,index) in news" :key="index" class="item">
<view class="new-content">{{item}}</view> <view class="new-content">{{item.title}}</view>
</swiper-item> </swiper-item>
</swiper> </swiper>
<image src="../../static/right-arrow.png" class="right-arrow"></image> <image src="../../static/right-arrow.png" class="right-arrow"></image>
</view> </view>
<!-- 常用应用 --> <!-- 常用应用 -->
<view class="bus-content"> <view class="bus-content" v-if="isCompShow('OnePointBusiness')">
<view class="tab-content"> <view class="tab-content">
<view class="tab-item" @click="select(0)"> <view class="tab-item" @click="select(0)">
<view :class="isCommonSel?'tab-text-sel':'tab-text'">常用业务</view> <view :class="isCommonSel?'tab-text-sel':'tab-text'">常用业务</view>
...@@ -68,7 +68,7 @@ ...@@ -68,7 +68,7 @@
</view> </view>
</view> </view>
<!-- 积分兑换 --> <!-- 积分兑换 -->
<view class="score-content"> <view class="score-content" v-if="isCompShow('OnePointScore')">
<view class="title-content"> <view class="title-content">
<view class="title">积分兑换</view> <view class="title">积分兑换</view>
<view class="more" @click="toLinkScore">更多</view> <view class="more" @click="toLinkScore">更多</view>
...@@ -125,27 +125,408 @@ ...@@ -125,27 +125,408 @@
appList: [{}], appList: [{}],
shopList: [{}, {}, {}], shopList: [{}, {}, {}],
isOrg: true, isOrg: true,
news: ["关于食堂发放免费午餐的人员名单关于食堂发放免费午餐的人员名单", "新闻头条"], news: [{
title: "关于食堂发放免费午餐的人员名单关于食堂发放免费午餐的人员名单"
}, {
title: "新闻头条"
}],
scoreDetail: {}, scoreDetail: {},
city: "杭州市", city: "杭州市",
address: "浙江省杭州市西湖区", address: "浙江省杭州市西湖区",
weather: { weather: {
"city": "\u676d\u5dde",
"cityid": 382,
"citycode": 101210101,
"date": "2022-12-28",
"week": "\u661f\u671f\u4e09",
"weather": "\u5c0f\u96e8", "weather": "\u5c0f\u96e8",
"temp": "4", "temp": "4",
"temphigh": "7",
"templow": "3",
"img": "7",
"humidity": "77",
"pressure": "1027",
"windspeed": "5.7",
"winddirect": "\u5317\u98ce",
"windpower": "4\u7ea7",
"updatetime": "2022-12-28 15:38:00",
"index": [{
"iname": "\u7a7a\u8c03\u6307\u6570",
"ivalue": "\u8f83\u5c11\u5f00\u542f",
"detail": "\u60a8\u5c06\u611f\u5230\u5f88\u8212\u9002\uff0c\u4e00\u822c\u4e0d\u9700\u8981\u5f00\u542f\u7a7a\u8c03\u3002"
},
{
"iname": "\u8fd0\u52a8\u6307\u6570",
"ivalue": "\u8f83\u4e0d\u5b9c",
"detail": "\u6709\u626c\u6c99\u6216\u6d6e\u5c18\uff0c\u5efa\u8bae\u9002\u5f53\u505c\u6b62\u6237\u5916\u8fd0\u52a8\uff0c\u9009\u62e9\u5728\u5ba4\u5185\u8fdb\u884c\u8fd0\u52a8\uff0c\u4ee5\u907f\u514d\u5438\u5165\u66f4\u591a\u6c99\u5c18\uff0c\u6709\u635f\u5065\u5eb7\u3002"
},
{
"iname": "\u7d2b\u5916\u7ebf\u6307\u6570",
"ivalue": "\u6700\u5f31",
"detail": "\u5c5e\u5f31\u7d2b\u5916\u7ebf\u8f90\u5c04\u5929\u6c14\uff0c\u65e0\u9700\u7279\u522b\u9632\u62a4\u3002\u82e5\u957f\u671f\u5728\u6237\u5916\uff0c\u5efa\u8bae\u6d82\u64e6SPF\u57288-12\u4e4b\u95f4\u7684\u9632\u6652\u62a4\u80a4\u54c1\u3002"
},
{
"iname": "\u611f\u5192\u6307\u6570",
"ivalue": "\u8f83\u6613\u53d1",
"detail": "\u5929\u6c14\u8f83\u51c9\uff0c\u8f83\u6613\u53d1\u751f\u611f\u5192\uff0c\u8bf7\u9002\u5f53\u589e\u52a0\u8863\u670d\u3002\u4f53\u8d28\u8f83\u5f31\u7684\u670b\u53cb\u5c24\u5176\u5e94\u8be5\u6ce8\u610f\u9632\u62a4\u3002"
},
{
"iname": "\u6d17\u8f66\u6307\u6570",
"ivalue": "\u4e0d\u5b9c",
"detail": "\u4e0d\u5b9c\u6d17\u8f66\uff0c\u672a\u676524\u5c0f\u65f6\u5185\u6709\u96e8\uff0c\u5982\u679c\u5728\u6b64\u671f\u95f4\u6d17\u8f66\uff0c\u96e8\u6c34\u548c\u8def\u4e0a\u7684\u6ce5\u6c34\u53ef\u80fd\u4f1a\u518d\u6b21\u5f04\u810f\u60a8\u7684\u7231\u8f66\u3002"
},
{
"iname": "\u7a7a\u6c14\u6c61\u67d3\u6269\u6563\u6307\u6570",
"ivalue": "\u826f",
"detail": "\u6c14\u8c61\u6761\u4ef6\u6709\u5229\u4e8e\u7a7a\u6c14\u6c61\u67d3\u7269\u7a00\u91ca\u3001\u6269\u6563\u548c\u6e05\u9664\uff0c\u53ef\u5728\u5ba4\u5916\u6b63\u5e38\u6d3b\u52a8\u3002"
},
{
"iname": "\u7a7f\u8863\u6307\u6570",
"ivalue": "\u51b7",
"detail": "\u5929\u6c14\u51b7\uff0c\u5efa\u8bae\u7740\u68c9\u670d\u3001\u7fbd\u7ed2\u670d\u3001\u76ae\u5939\u514b\u52a0\u7f8a\u6bdb\u886b\u7b49\u51ac\u5b63\u670d\u88c5\u3002\u5e74\u8001\u4f53\u5f31\u8005\u5b9c\u7740\u539a\u68c9\u8863\u3001\u51ac\u5927\u8863\u6216\u539a\u7fbd\u7ed2\u670d\u3002"
}
],
"aqi": {
"so2": "9",
"so224": "",
"no2": "45",
"no224": "",
"co": "1.1",
"co24": "",
"o3": "44",
"o38": "",
"o324": "",
"pm10": "159",
"pm1024": "",
"pm2_5": "129",
"pm2_524": "",
"iso2": "",
"ino2": "",
"ico": "",
"io3": "",
"io38": "",
"ipm10": "",
"ipm2_5": "",
"aqi": "171",
"primarypollutant": "PM25",
"quality": "\u4e2d\u5ea6\u6c61\u67d3",
"timepoint": "2022-12-28 14:00:00",
"aqiinfo": {
"level": "\u56db\u7ea7",
"color": "#FF0000",
"affect": "\u8fdb\u4e00\u6b65\u52a0\u5267\u6613\u611f\u4eba\u7fa4\u75c7\u72b6\uff0c\u53ef\u80fd\u5bf9\u5065\u5eb7\u4eba\u7fa4\u5fc3\u810f\u3001\u547c\u5438\u7cfb\u7edf\u6709\u5f71\u54cd",
"measure": "\u513f\u7ae5\u3001\u8001\u5e74\u4eba\u53ca\u5fc3\u810f\u75c5\u3001\u547c\u5438\u7cfb\u7edf\u75be\u75c5\u60a3\u8005\u907f\u514d\u957f\u65f6\u95f4\u3001\u9ad8\u5f3a\u5ea6\u7684\u6237\u5916\u953b\u70bc\uff0c\u4e00\u822c\u4eba\u7fa4\u9002\u91cf\u51cf\u5c11\u6237\u5916\u8fd0\u52a8"
}
},
"daily": [{
"date": "2022-12-28",
"week": "\u661f\u671f\u4e09",
"sunrise": "06:54",
"sunset": "17:07",
"night": {
"weather": "\u5c0f\u96e8",
"templow": "3",
"img": "7",
"winddirect": "\u6301\u7eed\u65e0\u98ce\u5411",
"windpower": "\u5fae\u98ce"
},
"day": {
"weather": "\u5c0f\u96e8",
"temphigh": "7",
"img": "7",
"winddirect": "\u5317\u98ce",
"windpower": "3-5\u7ea7"
}
},
{
"date": "2022-12-29",
"week": "\u661f\u671f\u56db",
"sunrise": "06:55",
"sunset": "17:07",
"night": {
"weather": "\u5c0f\u96e8",
"templow": "4",
"img": "7",
"winddirect": "\u4e1c\u98ce",
"windpower": "3-5\u7ea7"
},
"day": {
"weather": "\u5c0f\u96e8",
"temphigh": "7",
"img": "7",
"winddirect": "\u6301\u7eed\u65e0\u98ce\u5411",
"windpower": "\u5fae\u98ce"
}
},
{
"date": "2022-12-30",
"week": "\u661f\u671f\u4e94",
"sunrise": "06:55",
"sunset": "17:08",
"night": {
"weather": "\u591a\u4e91",
"templow": "2",
"img": "1",
"winddirect": "\u6301\u7eed\u65e0\u98ce\u5411",
"windpower": "\u5fae\u98ce"
},
"day": {
"weather": "\u9634",
"temphigh": "7",
"img": "2",
"winddirect": "\u6301\u7eed\u65e0\u98ce\u5411",
"windpower": "\u5fae\u98ce"
}
},
{
"date": "2022-12-31",
"week": "\u661f\u671f\u516d",
"sunrise": "06:55",
"sunset": "17:09",
"night": {
"weather": "\u9634",
"templow": "2",
"img": "2",
"winddirect": "\u6301\u7eed\u65e0\u98ce\u5411",
"windpower": "\u5fae\u98ce"
},
"day": {
"weather": "\u6674",
"temphigh": "11",
"img": "0",
"winddirect": "\u4e1c\u98ce",
"windpower": "3-5\u7ea7"
}
},
{
"date": "2023-01-01",
"week": "\u661f\u671f\u65e5",
"sunrise": "06:56",
"sunset": "17:09",
"night": {
"weather": "\u5c0f\u96e8",
"templow": "4",
"img": "7",
"winddirect": "\u6301\u7eed\u65e0\u98ce\u5411",
"windpower": "\u5fae\u98ce"
},
"day": {
"weather": "\u5c0f\u96e8",
"temphigh": "12",
"img": "7",
"winddirect": "\u4e1c\u98ce",
"windpower": "3-5\u7ea7"
}
},
{
"date": "2023-01-02",
"week": "\u661f\u671f\u4e00",
"sunrise": "06:56",
"sunset": "17:10",
"night": {
"weather": "\u5c0f\u96e8",
"templow": "5",
"img": "7",
"winddirect": "\u6301\u7eed\u65e0\u98ce\u5411",
"windpower": "\u5fae\u98ce"
},
"day": {
"weather": "\u5c0f\u96e8",
"temphigh": "9",
"img": "7",
"winddirect": "\u4e1c\u5317\u98ce",
"windpower": "3-5\u7ea7"
}
},
{
"date": "2023-01-03",
"week": "\u661f\u671f\u4e8c",
"sunrise": "06:56",
"sunset": "17:11",
"night": {
"weather": "\u9634",
"templow": "2",
"img": "2",
"winddirect": "\u6301\u7eed\u65e0\u98ce\u5411",
"windpower": "\u5fae\u98ce"
},
"day": {
"weather": "\u9634",
"temphigh": "9",
"img": "2",
"winddirect": "\u6301\u7eed\u65e0\u98ce\u5411",
"windpower": "\u5fae\u98ce"
}
}
],
"hourly": [{
"time": "15:00",
"weather": "\u591a\u4e91",
"temp": "7",
"img": "1"
},
{
"time": "16:00",
"weather": "\u591a\u4e91",
"temp": "7",
"img": "1"
},
{
"time": "17:00",
"weather": "\u5c0f\u96e8",
"temp": "7",
"img": "7"
},
{
"time": "18:00",
"weather": "\u591a\u4e91",
"temp": "7",
"img": "1"
},
{
"time": "19:00",
"weather": "\u591a\u4e91",
"temp": "6",
"img": "1"
},
{
"time": "20:00",
"weather": "\u5c0f\u96e8",
"temp": "5",
"img": "7"
},
{
"time": "21:00",
"weather": "\u591a\u4e91",
"temp": "5",
"img": "1"
},
{
"time": "22:00",
"weather": "\u5c0f\u96e8",
"temp": "5",
"img": "7"
},
{
"time": "23:00",
"weather": "\u5c0f\u96e8",
"temp": "5",
"img": "7"
},
{
"time": "0:00",
"weather": "\u5c0f\u96e8",
"temp": "5",
"img": "7"
},
{
"time": "1:00",
"weather": "\u591a\u4e91",
"temp": "5",
"img": "1"
},
{
"time": "2:00",
"weather": "\u5c0f\u96e8",
"temp": "5",
"img": "7"
},
{
"time": "3:00",
"weather": "\u591a\u4e91",
"temp": "5",
"img": "1"
},
{
"time": "4:00",
"weather": "\u591a\u4e91",
"temp": "5",
"img": "1"
},
{
"time": "5:00",
"weather": "\u5c0f\u96e8",
"temp": "4",
"img": "7"
},
{
"time": "6:00",
"weather": "\u591a\u4e91",
"temp": "4",
"img": "1"
},
{
"time": "7:00",
"weather": "\u591a\u4e91",
"temp": "4",
"img": "1"
},
{
"time": "8:00",
"weather": "\u5c0f\u96e8",
"temp": "4",
"img": "7"
},
{
"time": "9:00",
"weather": "\u591a\u4e91",
"temp": "5",
"img": "1"
},
{
"time": "10:00",
"weather": "\u5c0f\u96e8",
"temp": "5",
"img": "7"
},
{
"time": "11:00",
"weather": "\u5c0f\u96e8",
"temp": "6",
"img": "7"
},
{
"time": "12:00",
"weather": "\u5c0f\u96e8",
"temp": "7",
"img": "7"
},
{
"time": "13:00",
"weather": "\u591a\u4e91",
"temp": "7",
"img": "1"
},
{
"time": "14:00",
"weather": "\u5c0f\u96e8",
"temp": "7",
"img": "7"
}
]
}, },
userInfo: {} userInfo: {},
pageTemplateComponent: [],
isWeatherShow: true,
role: "VISITOR"
} }
}, },
onLoad() { onLoad() {
const info = uni.getSystemInfoSync() const info = uni.getSystemInfoSync()
this.statusBarHeight = info.statusBarHeight this.statusBarHeight = info.statusBarHeight
this.loginState()
}, },
onShow() { onShow() {
this.loginState()
this.getSetting() this.getSetting()
this.getMyScore() this.getMyScore()
this.getHomeComp()
}, },
methods: { methods: {
toLinkOther() {
uni.navigateTo({
url: "/pages/index/weather/weather?daily=" + JSON.stringify(this.weather.daily)
})
},
exchange(item) { exchange(item) {
uni.showModal({ uni.showModal({
title: '提示', title: '提示',
...@@ -180,13 +561,12 @@ ...@@ -180,13 +561,12 @@
getNews() { getNews() {
Api.getNews({ Api.getNews({
data: { data: {
pageNum: this.page, pageNum: 1,
pageSize: this.pageSize pageSize: 20
} }
}).then((res) => { }).then((result) => {
let result = res.data
if (result.code == 0) { if (result.code == 0) {
this.news = result.data this.news = result.data.list
} else { } else {
this.$toast.showToast(result.msg) this.$toast.showToast(result.msg)
} }
...@@ -233,7 +613,7 @@ ...@@ -233,7 +613,7 @@
success(res) { success(res) {
//获取用户信息 //获取用户信息
that.getUserInfo() that.getUserInfo()
that.getNews() // that.getNews()
}, },
fail() { fail() {
uni.showModal({ uni.showModal({
...@@ -253,22 +633,35 @@ ...@@ -253,22 +633,35 @@
}) })
}, },
getHomeComp() { getHomeComp() {
Api.getHomeComp().then((res) => { Api.getHomeComp({
let result = res.data data: {
templateKey: "one-point-mobile-page"
}
}).then((result) => {
if (result.code == 0) { if (result.code == 0) {
this.pageTemplateComponent = JSON.parse(result.data.pageTemplateComponent)
console.log("首页组件", this.pageTemplateComponent);
} else { } else {
this.$toast.showToast(result.msg) this.$toast.showToast(result.msg)
} }
}) })
}, },
isCompShow(comNo) {
let show = false
this.pageTemplateComponent.forEach((item) => {
if (item.com_no == "onepoint-weather") {
show = true
}
})
return show
},
getUserInfo() { getUserInfo() {
Api.getUserInfo().then((res) => { Api.getUserInfo().then((result) => {
let result = res.data
if (result.code == 0) { if (result.code == 0) {
getApp().globalData.userInfo = result.data getApp().globalData.userInfo = result.data
this.userInfo = result.data this.userInfo = result.data
this.title = "欢迎" + userInfo.user_name + "访问一点通" // this.title = "欢迎" + this.userInfo.user.user_name + "访问一点通"
this.role = this.userInfo.identity.code
} else { } else {
this.$toast.showToast(result.msg) this.$toast.showToast(result.msg)
} }
......
...@@ -3,21 +3,15 @@ ...@@ -3,21 +3,15 @@
<titleBar title="工地头条详情"></titleBar> <titleBar title="工地头条详情"></titleBar>
<view class="new-content"> <view class="new-content">
<view class="title-content"> <view class="title-content">
<text class="text">关于食堂发放免费午餐的消息通知</text> <text class="text">{{dealTitle(newDetail.title) }}</text>
</view> </view>
<view class="author-content"> <view class="author-content">
<text class="text">张三 </text> <text class="text">{{newDetail.updateUserName}}</text>
<text class="text" style="margin-left: 30rpx;">2022/12/14 16:52:56</text> <text class="text" style="margin-left: 30rpx;">{{newDetail.articleTime}}</text>
</view> </view>
<image src="https://img.redocn.com/sheying/20150804/gongdi_4770950.jpg" class="image"></image> <image src="https://img.redocn.com/sheying/20150804/gongdi_4770950.jpg" class="image"></image>
<view class="text-content"> <view class="text-content">
<text class="text">描述内容 <text class="text">{{newDetail.content}}</text>
描述内容描述内容描述内容描述内容描述内容
描述内容描述内容描述内容描述内容描述内容描述
内容描述内容描述内容描述内容容描述内
描述内容描述内容描述内容描述内容描述内容
描述内容描述内容描述述内。
</text>
</view> </view>
</view> </view>
<view class="other-content"> <view class="other-content">
...@@ -36,14 +30,43 @@ ...@@ -36,14 +30,43 @@
</template> </template>
<script> <script>
import Api from "../../../api/api.js"
export default { export default {
data() { data() {
return { return {
list: [{}] list: [{}],
newDetail: {
title: "关于食堂发放免费午餐的消息通知息通知",
updateUserName: "张三",
articleTime: "2022/12/14 16:52:56",
content: "由于工人数量大、居住集中等原因,工地防疫一度是各地面对的难题。此前,不同地区都要求进工地的建筑工人或一天一检,或两天一检,比一般社会面更严格。工地上中老年人多。 在某东部省会工作的基层干部周楠曾负责协调、 监督一些工地与医院对接做核酸。 她注意到, 工地上有一些“ 50 后” 的农民工, 他们没有智能手机, 做核酸时无法扫码, 只能出示身份证。 "
},
id: ""
} }
}, },
onLoad(options) {
this.id = options.id
},
methods: { 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> </script>
......
...@@ -8,8 +8,8 @@ ...@@ -8,8 +8,8 @@
<view class="list-content"> <view class="list-content">
<view v-for="(item,index) in list" :key="index" class="list-item" @click="toLinkDetail(item)"> <view v-for="(item,index) in list" :key="index" class="list-item" @click="toLinkDetail(item)">
<view class="new-content"> <view class="new-content">
<view class="title">关于食堂发放免费午餐的消息通知息通知</view> <view class="title">{{item.title}}</view>
<view class="user">张三 2022/12/14 16:52:56</view> <view class="user">{{item.updateUserName}} {{item.articleTime}}</view>
</view> </view>
<image class="image" src="../../../static/banner.png"></image> <image class="image" src="../../../static/banner.png"></image>
</view> </view>
...@@ -22,19 +22,28 @@ ...@@ -22,19 +22,28 @@
export default { export default {
data() { data() {
return { return {
list: [{}], list: [{
title: "关于食堂发放免费午餐的消息通知息通知",
updateUserName: "张三",
articleTime: "2022/12/14 16:52:56"
}],
page: 1, page: 1,
pageSize: 20 pageSize: 20,
isHasMore: true
} }
}, },
onLoad() { onLoad() {
// this.getNews()
}, },
onPullDownRefresh() { onPullDownRefresh() {
this.page = 1
this.getNews()
}, },
onReachBottom() { onReachBottom() {
if (this.isHasMore) {
this.page++
this.getNews()
}
}, },
methods: { methods: {
toLinkDetail(item) { toLinkDetail(item) {
...@@ -43,7 +52,7 @@ ...@@ -43,7 +52,7 @@
}) })
}, },
search(e) { search(e) {
}, },
getNews() { getNews() {
Api.getNews({ Api.getNews({
...@@ -51,10 +60,19 @@ ...@@ -51,10 +60,19 @@
pageNum: this.page, pageNum: this.page,
pageSize: this.pageSize pageSize: this.pageSize
} }
}).then((res) => { }).then((result) => {
let result = res.data uni.stopPullDownRefresh()
if (result.code == 0) { 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 { } else {
this.$toast.showToast(result.msg) 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> <template>
<view class="login-parent"> <view class="login-parent">
<titleBar title="微信绑定"></titleBar>
<view class="login-content"> <view class="login-content">
<view class="login-logo" v-if="false"> <view class="login-logo" v-if="false">
<image src="../../static/logo.png"></image> <image src="../../static/logo.png"></image>
...@@ -40,8 +41,8 @@ ...@@ -40,8 +41,8 @@
}, },
methods: { methods: {
register: function() { register: function() {
uni.redirectTo({ uni.navigateTo({
url: `../register/register?unique_token=${this.unique_token}&type=bind` url: `/pages/login/register/register?unique_token=${this.unique_token}&type=bind`
}) })
}, },
bindLogin() { bindLogin() {
...@@ -61,30 +62,25 @@ ...@@ -61,30 +62,25 @@
}) })
return return
} }
this.$http.consolePost({ Api.authLogin({
url: "/api/v1/system/p_user_third/user_third_bind",
data: { data: {
"user_no": this.account,
"third_type": 1,
"unique_token": this.unique_token, "unique_token": this.unique_token,
"password": this.password "user_no": this.isQuick ? this.phone : this.account,
} "third_type": 1
}).then((res) => { },
let result = res.data }).then((result) => {
console.log("登录用户信息:", result); console.log("登录用户信息:", result);
if (result.code === 0) { if (result.code === 0) {
uni.setStorageSync('isCanUse', false); //记录是否第一次授权 false:表示不是第一次授权 uni.setStorageSync('isCanUse', false); //记录是否第一次授权 false:表示不是第一次授权
this.setToken(result.data.access_token)
uni.setStorageSync("short_token", result.data.short_token) uni.setStorageSync("short_token", result.data.short_token)
uni.setStorageSync("token", result.data.access_token)
uni.setStorageSync("user_info", result.data) uni.setStorageSync("user_info", result.data)
uni.setStorageSync("company_id", result.data.comp_id)
uni.setStorageSync("refresh_token", result.data.refresh_token)
uni.showToast({ uni.showToast({
title: "登录成功", title: "授权登录成功",
icon: 'none' icon: 'none'
}) })
uni.switchTab({ uni.switchTab({
url: "../desk-page/desk-page" url: "/pages/index/index"
}) })
} else { } else {
uni.showToast({ uni.showToast({
......
...@@ -44,6 +44,7 @@ ...@@ -44,6 +44,7 @@
</template> </template>
<script> <script>
import Api from "../../../api/api.js"
export default { export default {
data() { data() {
return { return {
...@@ -91,20 +92,16 @@ ...@@ -91,20 +92,16 @@
}) })
return return
} }
this.$http.consolePost({ Api.sendCode({
url: "/api/v1/access/login/create_validate_code",
data: { data: {
"phone": this.phone, "phone": this.phone,
"usage_code": "1", "usage_code": "1",
"template_no": "industry-0001", "template_no": "industry-0001",
"system_no": this.systemCode "system_no": this.$config.systemCode
}, },
header: { }).then((res) => {
"Content-Type": "application/json"
}
}).then(function(res) {
console.log(res); console.log(res);
let code = res.data.code let code = res.code
if (code == 0) { if (code == 0) {
that.timeDown(that.downTime) that.timeDown(that.downTime)
uni.showToast({ uni.showToast({
...@@ -113,11 +110,10 @@ ...@@ -113,11 +110,10 @@
}) })
} else { } else {
uni.showToast({ uni.showToast({
title: res.data.msg, title: res.msg,
icon: 'none' icon: 'none'
}) })
} }
}) })
}, },
timeDown(num) { timeDown(num) {
...@@ -185,18 +181,13 @@ ...@@ -185,18 +181,13 @@
get_key() { get_key() {
// 先获取key 再登录 // 先获取key 再登录
let that = this let that = this
this.$http.consolePost({ Api.getKey({
url: "/api/v1/access/access_system/get_key",
data: { data: {
"system_no": this.$config.systemCode, "system_no": this.$config.systemCode,
"auth_code": this.$config.authCode "auth_code": this.$config.authCode
}, },
header: { }).then((result) => {
"Content-Type": "application/json" console.log(result);
}
}).then((res) => {
console.log(res);
let result = res.data
if (result.code === 0) { if (result.code === 0) {
that.toLogin(result.data.key) that.toLogin(result.data.key)
} else { } else {
...@@ -212,30 +203,25 @@ ...@@ -212,30 +203,25 @@
title: "授权绑定中..." title: "授权绑定中..."
}) })
let that = this let that = this
this.$http.consolePost({ Api.authLogin({
url: "/api/v1/system/p_user_third/user_third_bind",
data: { data: {
"unique_token": this.unique_token, "unique_token": this.unique_token,
"user_no": this.isQuick ? this.phone : this.account, "user_no": this.isQuick ? this.phone : this.account,
"third_type": 1 "third_type": 1
}, },
header: { }).then((result) => {
"Content-Type": "application/json"
}
}).then((res) => {
let result = res.data
console.log("登录用户信息:", result); console.log("登录用户信息:", result);
if (result.code === 0) { if (result.code === 0) {
uni.setStorageSync('isCanUse', false); //记录是否第一次授权 false:表示不是第一次授权 uni.setStorageSync('isCanUse', false); //记录是否第一次授权 false:表示不是第一次授权
uni.setStorageSync("short_token", result.data.short_token) 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.setStorageSync("user_info", result.data)
uni.showToast({ uni.showToast({
title: "授权登录成功", title: "授权登录成功",
icon: 'none' icon: 'none'
}) })
uni.switchTab({ uni.switchTab({
url: "../desk-page/desk-page" url:"/pages/index/index"
}) })
} else { } else {
uni.showToast({ uni.showToast({
...@@ -251,8 +237,7 @@ ...@@ -251,8 +237,7 @@
}) })
let that = this let that = this
if (this.isQuick) { if (this.isQuick) {
this.$http.consolePost({ Api.login({
url: "/api/v1/access/login/do_login",
data: { data: {
"phone": this.phone, "phone": this.phone,
"code": this.code, "code": this.code,
...@@ -263,12 +248,11 @@ ...@@ -263,12 +248,11 @@
"key": key, "key": key,
"Content-Type": "application/json" "Content-Type": "application/json"
} }
}).then((res) => { }).then((result) => {
let result = res.data
console.log("登录用户信息:", result); console.log("登录用户信息:", result);
if (result.code === 0) { if (result.code === 0) {
uni.setStorageSync('isCanUse', false); //记录是否第一次授权 false:表示不是第一次授权 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("short_token", result.data.short_token)
uni.setStorageSync("user_info", result.data) uni.setStorageSync("user_info", result.data)
uni.setStorageSync("company_id", result.data.comp_id) uni.setStorageSync("company_id", result.data.comp_id)
...@@ -281,11 +265,8 @@ ...@@ -281,11 +265,8 @@
this.toAuthLogin() this.toAuthLogin()
} else { } else {
uni.switchTab({ uni.switchTab({
url: "../index/index" url: "/pages/index/index"
}) })
// uni.switchTab({
// url: "../index/index"
// })
} }
} else { } else {
uni.showToast({ uni.showToast({
...@@ -295,25 +276,23 @@ ...@@ -295,25 +276,23 @@
} }
}) })
} else { } else {
this.$http.consolePost({ Api.login({
url: "/api/v1/access/login/do_login",
data: { data: {
"user_no": this.account, "user_no": this.account,
"password": this.password, "password": this.password,
"login_type": 1, "login_type": 1,
"system_no": this.systemCode "system_no": this.$config.systemCode
}, },
header: { header: {
"key": key, "key": key,
"Content-Type": "application/json" "Content-Type": "application/json"
} }
}).then((res) => { }).then((result) => {
let result = res.data
console.log("登录用户信息:", result); console.log("登录用户信息:", result);
if (result.code === 0) { if (result.code === 0) {
uni.setStorageSync('isCanUse', false); //记录是否第一次授权 false:表示不是第一次授权 uni.setStorageSync('isCanUse', false); //记录是否第一次授权 false:表示不是第一次授权
uni.setStorageSync("token", result.data.access_token)
uni.setStorageSync("short_token", result.data.short_token) uni.setStorageSync("short_token", result.data.short_token)
that.setToken(result.data.access_token)
uni.setStorageSync("user_info", result.data) uni.setStorageSync("user_info", result.data)
uni.setStorageSync("company_id", result.data.comp_id) uni.setStorageSync("company_id", result.data.comp_id)
uni.setStorageSync("refresh_token", result.data.refresh_token) uni.setStorageSync("refresh_token", result.data.refresh_token)
...@@ -325,11 +304,8 @@ ...@@ -325,11 +304,8 @@
this.toAuthLogin() this.toAuthLogin()
} else { } else {
uni.switchTab({ uni.switchTab({
url: "../desk-page/desk-page" url: "/pages/index/index"
}) })
// uni.switchTab({
// url: "../index/index"
// })
} }
} else { } else {
uni.showToast({ uni.showToast({
......
...@@ -156,7 +156,7 @@ ...@@ -156,7 +156,7 @@
if (result.code === 0) { if (result.code === 0) {
uni.setStorageSync('isCanUse', false); //记录是否第一次授权 false:表示不是第一次授权 uni.setStorageSync('isCanUse', false); //记录是否第一次授权 false:表示不是第一次授权
uni.setStorageSync("short_token", result.data.short_token) 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("user_info", result.data)
uni.setStorageSync("company_id", result.data.comp_id) uni.setStorageSync("company_id", result.data.comp_id)
uni.setStorageSync("refresh_token", result.data.refresh_token) uni.setStorageSync("refresh_token", result.data.refresh_token)
...@@ -188,7 +188,7 @@ ...@@ -188,7 +188,7 @@
console.log("登录用户信息:", result); console.log("登录用户信息:", result);
if (result.code === 0) { if (result.code === 0) {
uni.setStorageSync('isCanUse', false); //记录是否第一次授权 false:表示不是第一次授权 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("short_token", result.data.short_token)
uni.setStorageSync("user_info", result.data) uni.setStorageSync("user_info", result.data)
uni.setStorageSync("company_id", result.data.comp_id) uni.setStorageSync("company_id", result.data.comp_id)
...@@ -255,20 +255,16 @@ ...@@ -255,20 +255,16 @@
}) })
return return
} }
this.$http.consolePost({ Api.sendCode({
url: "/api/v1/access/login/create_validate_code",
data: { data: {
"phone": this.phone, "phone": this.phone,
"usage_code": "2", "usage_code": "2",
"template_no": "industry-0001", "template_no": "industry-0001",
"system_no": this.$config.systemCode "system_no": this.$config.systemCode
}, },
header: { }).then((res) => {
"Content-Type": "application/json"
}
}).then(function(res) {
console.log(res); console.log(res);
let code = res.data.code let code = res.code
if (code == 0) { if (code == 0) {
that.timeDown(that.downTime) that.timeDown(that.downTime)
uni.showToast({ uni.showToast({
...@@ -277,11 +273,10 @@ ...@@ -277,11 +273,10 @@
}) })
} else { } else {
uni.showToast({ uni.showToast({
title: res.data.msg, title: res.msg,
icon: 'none' icon: 'none'
}) })
} }
}) })
}, },
timeDown(num) { timeDown(num) {
......
...@@ -86,6 +86,7 @@ ...@@ -86,6 +86,7 @@
this.requestParam.worker_id = this.userInfo.worker_id || '' this.requestParam.worker_id = this.userInfo.worker_id || ''
this.requestParam.project_id = this.project.project_id || '' this.requestParam.project_id = this.project.project_id || ''
this.getScoreDetail() this.getScoreDetail()
this.$mta("我的积分", "pages/mine/myScore/myScore")
}, },
methods: { methods: {
getScoreDetail() { getScoreDetail() {
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
Please register or to comment