Browse Source

市民云

dev
396316021 6 months ago
parent
commit
1cd5bab91b
  1. 9
      api/user.js
  2. 1126
      components/AdvisorPage/index.vue
  3. 7
      components/FooterNav/index.vue
  4. 6
      config/config.js
  5. 5
      config/host.js
  6. 1
      index.html
  7. 2
      pages/Address/edit.vue
  8. 13
      pages/Index/components/ShopPage/index.vue
  9. 22
      pages/Index/index.vue
  10. 28
      pages/Line/components/ListPage/index.vue
  11. 10
      pages/Line/index.vue
  12. 61
      pages/Login/index.vue
  13. 2
      pages/News/index.vue
  14. 2
      uni_modules/m-view/lib/tools.js
  15. 3
      utils/functions.js

9
api/user.js

@ -1,5 +1,5 @@
import request from "@/utils/request.js";
import {host} from "@/config/host.js";
import {host,cloud_host} from "@/config/host.js";
/**
* 登录
@ -21,6 +21,13 @@ export function appletLogin(data) {
data
});
}
export function cloudLogin(data) {
return request({
url: `${cloud_host}/api/oauth/authorize`,
method: "get",
data
});
}
export function userDetail(data) {

1126
components/AdvisorPage/index.vue

File diff suppressed because it is too large Load Diff

7
components/FooterNav/index.vue

@ -23,6 +23,10 @@ export default {
button:{
type:Object,
default:[],
},
footCheckProp:{
type:String,
default:'',
}
},
data() {
@ -46,6 +50,9 @@ export default {
that.$emit('change', item)
},
},
mounted() {
this.footCheck = this.footCheckProp;
},
watch: {
}

6
config/config.js

@ -60,3 +60,9 @@ export const DEFAULT_LIST_PAGE = {
* @type {string}
*/
export const UPLOAD_PATH = '/common/upload';
export const CLOUD_CLIENT_ID = '2f42346b72';
export const CLOUD_SECRET_KEY = '2615d5cdf6294f5db6166677';
export const CLOUD_LOGIN_PATH = 'https://nxr.smy.fanyiguanjia.com/';

5
config/host.js

@ -1,10 +1,13 @@
// const host='http://192.168.2.92:9505/api'
const host='https://nxr.fanyiguanjia.com/api'
// const host='https://nxr.test.fanyiguanjia.com/api'
const h5_host='https://nxr.smy.fanyiguanjia.com/'
const cloud_host='https://cdpre.tfsmy.com/api'
// const host='http://192.168.2.92:9503/api'
const imghost='https://nxr.fanyiguanjia.com/icon/static/image'
// const imghost='https://nxr.test.fanyiguanjia.com/icon/static/image'
const title = '暖新人'
// const codehost='http://code.baomingle.cn'
const oss = 'https://fanyi-guanjia-1.'+'oss-cn-chengdu.aliyuncs.com'
export {host,imghost,title,oss}
export {host,imghost,title,oss,h5_host,cloud_host}

1
index.html

@ -16,5 +16,6 @@
<body>
<div id="app"><!--app-html--></div>
<script type="module" src="/main.js"></script>
<script src="https://cdpre.tfsmy.com/api/js/eshiminJS-1.0.0.js"></script>
</body>
</html>

2
pages/Address/edit.vue

@ -324,7 +324,9 @@ export default {
}
},
created() {
//#ifdef MP-WEIXIN
this.listHeight();
// #endif
// this.pagePadding = (api.navHeight().navPaddingTop +
// api.navHeight().navHeight + (api.navHeight().headerPadding * 2))
}

13
pages/Index/components/ShopPage/index.vue

@ -1,6 +1,13 @@
<template>
<view class="body-background"></view>
<m-sticky type="sticky" :offset-top="topStyle">
//#ifdef MP-WEIXIN
<view class="screen-body row" :class="{pad:(tabCheck === 'item')}" :style="{top:topStyle}">
// #endif
//#ifdef H5
<view class="screen-body row" :class="{pad:(tabCheck === 'item')}">
// #endif
<u-row :custom-style="{boxSizing:'border-box',width:'100%',flexWrap:'wrap'}">
<u-col :custom-style="{backgroundColor:'#fff',borderRadius:'10rpx',padding:'0rpx 26rpx',boxSizing:'border-box'}" v-if="showTabs">
<u-tabs
@ -94,6 +101,7 @@
</u-row>
</view>
</m-sticky>
<view class="map-container" :style="{display:((tabCheck === 'room')?'flex':'none')}" >
<view class="top-map" :style="{marginTop:size.height+'px'}" v-if="(tabCheck === 'room')">
<view id="map" class="map" v-if="showMap">
@ -337,7 +345,12 @@ const img = 'https://qiniu-web-assets.dcloud.net.cn/unidoc/zh/logo.png';
export default {
computed: {
topStyle(){
//#ifdef MP-WEIXIN
return uni.getStorageSync('sysInfo').sysAndMenuHeight+'px';
// #endif
// #ifdef H5
return '44px';
// #endif
}
},
components: {

22
pages/Index/index.vue

@ -25,7 +25,12 @@
@change="change1"
custom-style="z-index:9999;"
>
//#ifdef MP-WEIXIN
<FooterNav ref="footNav" :button="buttonGroup" style="width:100%;" @change="footSelect"></FooterNav>
// #endif
//#ifdef H5
<FooterNav :footCheckProp="footCheck" :button="buttonGroup" style="width:100%;" @change="footSelect"></FooterNav>
// #endif
</u-tabbar>
<u-modal :show="show" title="登录" content="当前未登录是否前往登录" @confirm="userLogin" @cancel="this.show = false;"
:closeOnClickOverlay="true" showCancelButton></u-modal>
@ -113,13 +118,19 @@ export default {
}
},
onLoad(option) {
console.log(option)
console.log('index',option)
if (option.footCheck) {
this.buttonGroup.forEach((item, index) => {
if (item.name === option.footCheck) {
console.log('foot', item)
//#ifdef MP-WEIXIN
this.footCheck = this.$refs.footNav.footCheck = item.name;
// #endif
//#ifdef H5
this.footCheck = item.name;
// #endif
this.title = item.title;
}
})
@ -146,8 +157,13 @@ export default {
onReady() {
let that = this;
// let height = api.wxSystemInfo().system.windowHeight
//#ifdef MP-WEIXIN
this.marginTop = (uni.$u.getPx(44) + uni.$u.sys().statusBarHeight);
this.$refs.home.marginTop = this.marginTop;
this.$refs.home.marginTop = that.marginTop;
// #endif
//#ifdef MP-WEIXIN
this.$refs.home.marginTop = that.marginTop = uni.$u.getPx(44);
// #endif
},
onReachBottom() {
if (this.footCheck === 'shop') {
@ -226,6 +242,8 @@ export default {
if (token) {
this.getUserExtend();
}
},
watch: {
"$store.state.footCheck": {

28
pages/Line/components/ListPage/index.vue

@ -4,23 +4,23 @@
<view class="card-container border-box">
<view class="card-item border-box" v-for="(item,index) in lists">
<view class="card-main border-box">
<view class="background-view " :class="item.status === 1 ?'blue':'green'"></view>
<view class="background-view " :class="item?.status === 1 ?'blue':'green'"></view>
<view class="title-group row">
<view class="label">提交时间</view>
<view class="content">{{item.create_time}}</view>
<view class="status" :class="item.status === 1 ?'blue':'green'">{{ item.status === 1 ?'待办结':'已办结' }}</view>
<view class="content">{{item?.create_time}}</view>
<view class="status" :class="item?.status === 1 ?'blue':'green'">{{ item?.status === 1 ?'待办结':'已办结' }}</view>
</view>
<view class="main-hr"></view>
<view class="body-group border-box">
<view class="body-item row">
<view class="label">事件类型</view>
<view class="content">{{item.clue_type}}</view>
<view class="content">{{item?.clue_type}}</view>
</view>
<view class="body-item row">
<view class="label">事件地址</view>
<view class="content col">
<u-text
:text="item.address"
:text="item?.address"
size="28"
color="#020B18"
custom-style="display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 1; overflow: hidden; "></u-text>
@ -29,9 +29,9 @@
</view>
<view class="body-item row">
<view class="label">文字说明</view>
<view class="content">{{item.describe}}</view>
<view class="content">{{item?.describe}}</view>
</view>
<view class="body-item row image" v-if="item.images || item.video">
<view class="body-item row image" v-if="item?.images || item?.video">
<view class="label">图片视频</view>
<view class="content row">
<view class="content-img col-6" v-for="itemImg in item.images" v-if="item.images">
@ -45,7 +45,7 @@
</view>
</view>
<view class="card-ext">
<view class="card-main border-box" v-if="item.handle_time && (item.status ===2)">
<view class="card-main border-box" v-if="item?.handle_time && (item.status ===2)">
<view class="line-gun-container">
<view class="line-gun row">
<u-image mode="widthFix" width="24" height="84" :src="staticImage.lineGun"></u-image>
@ -214,21 +214,25 @@ export default {
if(!this.isUserList){
lineList(data).then(res => {
if(res.data.length === 0){
if(res.data?.length === 0){
this.status = 'nomore';
}else{
this.status = 'loadmore';
}
this.lists = this.lists.concat(res.data);
if(res.code === 200){
this.lists = this.lists.concat(res.data);
}
});
}else{
userLineList(data).then(res => {
if(res.data.length === 0){
if(res.data?.length === 0){
this.status = 'nomore';
}else{
this.status = 'loadmore';
}
this.lists = this.lists.concat(res.data);
if(res.code === 200){
this.lists = this.lists.concat(res.data);
}
});
}

10
pages/Line/index.vue

@ -28,7 +28,7 @@
<u-col :span="4">
<view class="screen-type">
<view class="screen-type-button row ">
<view class="button-text" @click="$refs.lineLists.showTypePicker">
<view class="button-text" @click="showTypePicker">
<u-text :text="typeCheck?typeCheck:'事件类型'" size="28" color="#020B18" custom-style="display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 1; overflow: hidden;"></u-text>
</view>
<view class="button-icon">
@ -40,7 +40,7 @@
<u-col :span="8">
<view class="screen-date col-7">
<view class="screen-date-button row col">
<view class="date-text" @click="$refs.lineLists.showStartTimePicker"
<view class="date-text" @click="showStartTimePicker"
style="max-width:90%;display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 1; overflow: hidden;">
<view class="date-item">
<u-text mode="date" :text="startTime||0" size="28" color="#020B18" custom-style=""></u-text>
@ -158,6 +158,12 @@
},
selectEnd(event){
this.endTime = event;
},
showTypePicker(){
this.$refs.lineLists.showTypePicker();
},
showStartTimePicker(){
this.$refs.lineLists.showStartTimePicker();
},
},
onPageScroll(res) {

61
pages/Login/index.vue

@ -20,7 +20,7 @@
</view>
</view>
<view class="login-button-container">
<!--#ifdef MP-WEIXIN-->
<u-button
v-if="!isRead"
type="success"
@ -30,7 +30,6 @@
height="88"
@click="readTip()"
>
<!-- <u-icon name="weixin-fill" size="50" color="#fff" class="weixin-icon"></u-icon>-->
<u-text text="手机号快捷登录" color="#fff" size="32" align="center" custom-style="display:inline;"></u-text>
</u-button>
<u-button
@ -43,7 +42,6 @@
color="#FF9545"
height="88"
>
<!-- <u-icon name="weixin-fill" size="50" color="#fff" class="weixin-icon"></u-icon>-->
<u-text text="手机号快捷登录" color="#fff" size="32" align="center" custom-style="display:inline;"></u-text>
</u-button>
<u-button
@ -55,10 +53,33 @@
height="88"
@click="openPopup"
>
<!-- <u-icon name="weixin-fill" size="50" color="#fff" class="weixin-icon"></u-icon>-->
<u-text text="手机号快捷登录" color="#fff" size="32" align="center" custom-style="display:inline;"></u-text>
</u-button>
<!--#endif-->
<!--#ifdef H5-->
<u-button
type="success"
size="normal"
shape="circle"
color="#FF9545"
height="88"
@click="peopleCloudLogin"
>
<u-text text="快捷登录" color="#fff" size="32" align="center" custom-style="display:inline;"></u-text>
</u-button>
<u-button
type="success"
size="normal"
shape="circle"
color="#FF9545"
height="88"
@click="login"
>
<u-text text="手机号快捷登录" color="#fff" size="32" align="center" custom-style="display:inline;"></u-text>
</u-button>
<!--#endif-->
</view>
<!--#ifdef MP-WEIXIN-->
<view class="privacy-container row" style="align-items: center;">
<view class="checkbox">
<u-checkbox :checked="isRead" @change="isRead = !isRead" shape="circle" active-color="#FF9545" icon-size="30rpx" size="40rpx"></u-checkbox>
@ -76,14 +97,7 @@
<!-- <u-text text="《隐私政策》" color="#178AF2" size="24"></u-text>-->
<!-- </view>-->
</view>
<!-- <u-button-->
<!-- type="success"-->
<!-- size="large"-->
<!-- @click="login"-->
<!-- >-->
<!-- <u-icon name="weixin-circle-fill" size="50" color="#fff" class="weixin-icon"></u-icon>-->
<!-- 登录-->
<!-- </u-button>-->
<!--#endif-->
<uv-popup ref="popup" type="center" :is-mask-click="false" round="20" mode="bottom">
<view class="popup-box" style="padding:40rpx">
<view style="padding:20rpx 0;">
@ -120,12 +134,12 @@
</template>
<script>
import {
imghost
} from '@/config/host.js'
import {imghost} from '@/config/host.js'
import MzSubsection from '@/components/MzSubsection/Index.vue';
import api from '@/utils/functions.js';
import {appletLogin, testLogin, userDetail} from "@/api/user";
import {CLOUD_CLIENT_ID, CLOUD_LOGIN_PATH} from "../../config/config";
import {cloud_host} from "../../config/host";
export default {
components: {
@ -165,8 +179,12 @@ export default {
}).then((res) => {
uni.setStorageSync('token',res.data.token);
userDetail().then((res) => {
// uni.setStorageSync('token',res.data.token);
uni.setStorageSync('user',res.data);
this.$store.commit('userInfo',res.data);
this.$store.commit('userInfo', res.data);
uni.navigateBack({
delta:1,
})
});
});
},
@ -205,7 +223,14 @@ export default {
},
handleDisagree(){
this.$refs.popup.close();
}
},
peopleCloudLogin(){
window.location.href = `${cloud_host}/oauth/?client_id=${CLOUD_CLIENT_ID}&response_type=code&redirect_uri=${CLOUD_LOGIN_PATH}&scope=read`;
// console.log(url)
// uni.redirectTo({
// url:url
// });
},
},
onPageScroll(res) {
if (res.scrollTop <= 20) {
@ -218,6 +243,7 @@ export default {
},
mounted() {
//#ifdef MP-WEIXIN
uni.getPrivacySetting({
success: res => {
console.log("是否需要授权:", res.needAuthorization, "隐私协议的名称为:", res.privacyContractName)
@ -231,6 +257,7 @@ export default {
},
complete: () => {},
})
// #endif
},
}
</script>

2
pages/News/index.vue

@ -202,7 +202,9 @@ export default {
}
},
created() {
//#ifdef MP-WEIXIN
this.listHeight();
// #endif
// this.pagePadding = (api.navHeight().navPaddingTop +
// api.navHeight().navHeight + (api.navHeight().headerPadding * 2))
}

2
uni_modules/m-view/lib/tools.js

@ -1,5 +1,3 @@
import QQMapWX from "@/uni_modules/m-view/lib/qqmap-wx-jssdk.min";
export default {
/**
* 添加单位

3
utils/functions.js

@ -142,6 +142,9 @@ const api = {
let address = timer.getFullYear() + '' + (timer.getMonth() + 1) + '' + timer.getDate();
address = 'upload/' + address + '/';
var imageSrc = file;
if(typeof file === 'object'){
file = file[0];
}
let str = file.substr(file.lastIndexOf('.'));
let nameStr = address + timer.getTime() + str;
uni.uploadFile({

Loading…
Cancel
Save