Browse Source

提交第二个版本

v2
前端-胡立永 3 months ago
parent
commit
6493ff3125
17 changed files with 222 additions and 73 deletions
  1. +4
    -4
      service-uniapp-client/.env
  2. +2
    -0
      service-uniapp-client/App.vue
  3. +55
    -38
      service-uniapp-client/components/selectArea.vue
  4. +8
    -0
      service-uniapp-client/main.js
  5. +1
    -1
      service-uniapp-client/manifest.json
  6. +14
    -0
      service-uniapp-client/mixins/configList.js
  7. +1
    -1
      service-uniapp-client/pages.json
  8. +5
    -5
      service-uniapp-client/pages/index/index.vue
  9. +1
    -1
      service-uniapp-client/pages/login/login.vue
  10. +21
    -7
      service-uniapp-client/plugins/upload.js
  11. BIN
      service-uniapp-client/static/login/logo.png
  12. +70
    -0
      service-uniapp-client/store/store.js
  13. +13
    -4
      service-uniapp-client/utils/Share.js
  14. +3
    -3
      service-uniapp-technician/.env
  15. +1
    -1
      service-uniapp-technician/manifest.json
  16. +1
    -1
      service-uniapp-technician/pages.json
  17. +22
    -7
      service-uniapp-technician/plugins/upload.js

+ 4
- 4
service-uniapp-client/.env View File

@ -1,13 +1,13 @@
# 开发环境 # 开发环境
#VITE_GLOB_API=http://h5.xzaiyp.top/massage-api
#VITE_GLOB_API=http://h5.xzaiyp.top/massage-api-tiandu
#VITE_REDIRECT_URI=http://tairoudj.natapp1.cc #VITE_REDIRECT_URI=http://tairoudj.natapp1.cc
# 生产环境 # 生产环境
VITE_GLOB_API=https://tai-testapi.sanhemovie.com/massage-api
VITE_REDIRECT_URI=https://tai-testh5.sanhemovie.com
VITE_GLOB_API=https://admin.tiandufuwu.com/massage-api-tiandu
VITE_REDIRECT_URI=https://h5.tiandufuwu.com
VITE_APPID=wxe934cebcbc89d869
VITE_APPID=wx2cc6f138b02196e3
VITE_MAP_KEY=V5RBZ-QRK63-JAO3B-RLSOB-FLWJF-DVFGH VITE_MAP_KEY=V5RBZ-QRK63-JAO3B-RLSOB-FLWJF-DVFGH

+ 2
- 0
service-uniapp-client/App.vue View File

@ -5,6 +5,8 @@
export default { export default {
onLaunch: function() { onLaunch: function() {
this.$.appContext.app.use(plugins) this.$.appContext.app.use(plugins)
this.$store.commit('initConfig')
this.$store.commit('getArea')
}, },
onShow: function() { onShow: function() {
share() share()


+ 55
- 38
service-uniapp-client/components/selectArea.vue View File

@ -1,66 +1,83 @@
<template> <template>
<!-- 选择地区 --> <!-- 选择地区 -->
<van-popup
v-model:show="showArea"
round
position="bottom"
@close="showArea = false"
>
<!-- <van-picker
<van-popup v-model:show="showArea" round position="bottom" @close="showArea = false">
<!-- <van-picker
title="地区选择" :columns="columns1" @confirm="onConfirm" @cancel="onCancel" title="地区选择" :columns="columns1" @confirm="onConfirm" @cancel="onCancel"
/> --> /> -->
<van-picker title="选择地区" :columns="columns" :columns-field-names="customFieldName" @cancel="onCancel" @confirm="onConfirm"/>
<van-picker title="选择地区"
:columns="columns"
:columns-field-names="customFieldName"
@cancel="onCancel"
@confirm="onConfirm" />
</van-popup> </van-popup>
</template> </template>
<script> <script>
export default { export default {
props : ['show'],
name:"selectArea",
props: ['show'],
name: "selectArea",
data() { data() {
return { return {
showArea : false,
columns : [],
columns1 : [
{ text: '星沙区', value: '星沙区' },
{ text: '雨花区', value: '雨花区' },
{ text: '岳麓区', value: '岳麓区' },
{ text: '天心区', value: '天心区' },
{ text: '开福区', value: '开福区' }
],
customFieldName : {
text: 'name',
value: 'name',
children: 'children'
showArea: false,
columns: [],
columns1: [{
text: '星沙区',
value: '星沙区'
},
{
text: '雨花区',
value: '雨花区'
},
{
text: '岳麓区',
value: '岳麓区'
},
{
text: '天心区',
value: '天心区'
},
{
text: '开福区',
value: '开福区'
}
],
customFieldName: {
text: 'name',
value: 'name',
children: 'children'
} }
} }
}, },
watch: { watch: {
show: { show: {
handler (newValue, oldValue) {
this.showArea = newValue
},
immediate: true
handler(newValue, oldValue) {
this.showArea = newValue
},
immediate: true
} }
}, },
created(){
created() {
this.getCurrentArea(); this.getCurrentArea();
}, },
methods : {
onConfirm(selectArea){
this.$emit('select',selectArea.selectedValues.pop())
methods: {
onConfirm(selectArea) {
this.$store.commit('setArea', selectArea.selectedOptions[2])
this.showArea = false
this.$emit('select')
// this.$emit('select', selectArea.selectedValues.pop())
}, },
onCancel(){
onCancel() {
this.$emit('close') this.$emit('close')
}, },
getCurrentArea(){ //
let self = this;
getCurrentArea() { //
let self = this;
this.$api('getCurrentArea', this.queryParams, res => { this.$api('getCurrentArea', this.queryParams, res => {
if (res.code == 200) { if (res.code == 200) {
this.columns = this.handleTree(res.result,'id','pid')
// 使pop
const lastElement = this.columns[0].children[0].children.pop();
this.columns[0].children[0].children.unshift(lastElement)
this.columns = this.handleTree(res.result, 'id', 'pid')
// 使pop
// const lastElement = this.columns[0].children[0].children.pop();
// this.columns[0].children[0].children.unshift(lastElement)
} }
}) })
} }


+ 8
- 0
service-uniapp-client/main.js View File

@ -21,9 +21,12 @@ import vant from 'vant';
import jweixin from './utils/jweixin-module.js' import jweixin from './utils/jweixin-module.js'
import mixinConfigList from '@/mixins/configList.js'
import uniIcons from '@/uni_modules/uni-icons/components/uni-icons/uni-icons.vue' import uniIcons from '@/uni_modules/uni-icons/components/uni-icons/uni-icons.vue'
import uniDrawer from '@/uni_modules/uni-drawer/components/uni-drawer/uni-drawer.vue' import uniDrawer from '@/uni_modules/uni-drawer/components/uni-drawer/uni-drawer.vue'
import store from '@/store/store'
//获取url中参数的方法 //获取url中参数的方法
function GetQueryString(name) { function GetQueryString(name) {
@ -44,6 +47,11 @@ export function createApp() {
const app = createSSRApp(App) const app = createSSRApp(App)
app.use(vant) app.use(vant)
app.use(store)
app.mixin(mixinConfigList)
return { return {
app app
} }


+ 1
- 1
service-uniapp-client/manifest.json View File

@ -1,5 +1,5 @@
{ {
"name" : "秦柔到家",
"name" : "天都服务",
"appid" : "__UNI__1EF9D8C", "appid" : "__UNI__1EF9D8C",
"description" : "", "description" : "",
"versionName" : "1.0.0", "versionName" : "1.0.0",


+ 14
- 0
service-uniapp-client/mixins/configList.js View File

@ -0,0 +1,14 @@
import { mapState } from 'vuex'
export default {
data() {
return {
}
},
computed: {
...mapState(['configList', 'userInfo', 'selectArea']),
},
methods: {
}
}

+ 1
- 1
service-uniapp-client/pages.json View File

@ -177,7 +177,7 @@
], ],
"globalStyle": { "globalStyle": {
"navigationBarTextStyle": "black", "navigationBarTextStyle": "black",
"navigationBarTitleText": "秦柔到家",
"navigationBarTitleText": "天都服务",
"navigationBarBackgroundColor": "#F8F8F8", "navigationBarBackgroundColor": "#F8F8F8",
"backgroundColor": "#F8F8F8", "backgroundColor": "#F8F8F8",
"navigationStyle":"custom" "navigationStyle":"custom"


+ 5
- 5
service-uniapp-client/pages/index/index.vue View File

@ -47,7 +47,7 @@
<view @click="showSelectArea" class="left-area"> <view @click="showSelectArea" class="left-area">
<image src="@/static/home/address-icon.png"></image> <image src="@/static/home/address-icon.png"></image>
<view class="area">{{ area }}</view>
<view class="area">{{ selectArea.name }}</view>
<image src="../../static/home/arrow-icon.png" mode="aspectFit"></image> <image src="../../static/home/arrow-icon.png" mode="aspectFit"></image>
<view class="parting-line">|</view> <view class="parting-line">|</view>
</view> </view>
@ -141,7 +141,7 @@
onShow() { onShow() {
this.getBanner() this.getBanner()
this.getProject() this.getProject()
this.getLocation()
// this.getLocation()
}, },
methods: { methods: {
//list //list
@ -205,11 +205,11 @@
// //
selectArea(area) { selectArea(area) {
this.area = area;
// this.area = area;
this.showAeraPro = false; this.showAeraPro = false;
//
this.updateSessionPositon(area)
// //
// this.updateSessionPositon(area)
}, },
// //


+ 1
- 1
service-uniapp-client/pages/login/login.vue View File

@ -4,7 +4,7 @@
<view class="a1">手机号快捷登录</view> <view class="a1">手机号快捷登录</view>
<view class="a2">美好服务即刻享受</view> <view class="a2">美好服务即刻享受</view>
<view class="a3" @click="clickStaff"> <view class="a3" @click="clickStaff">
<image src="@/static/login/logo.png" mode="aspectFit"></image>
<image :src="configList.logo_image" mode="aspectFit"></image>
</view> </view>
<view class="a4">上门服务服务平台</view> <view class="a4">上门服务服务平台</view>


+ 21
- 7
service-uniapp-client/plugins/upload.js View File

@ -19,14 +19,28 @@ function uploadFileToOSS(file) {
// endpoint:'oss-cn-shenzhen.aliyuncs.com' // endpoint:'oss-cn-shenzhen.aliyuncs.com'
//桶的地址 //桶的地址
region: 'oss-cn-guangzhou',
//id
accessKeyId:'LTAI5tNycA46YTwm383dRvMV',
// region: 'oss-cn-guangzhou',
// //id
// accessKeyId:'LTAI5tNycA46YTwm383dRvMV',
// //密钥
// accessKeySecret:'tAdbYQCmdur6jbZ8hjvgB7T1Z52mIG',
// //桶的名字
// bucket: 'zhuoqiu-image',
// endpoint:'oss-cn-guangzhou.aliyuncs.com',
/**
* 自己的
*/
//桶的地址
region: 'oss-cn-guangzhou',
//id
accessKeyId: 'LTAI5tQSs47izVy8DLVdwUU9',
//密钥 //密钥
accessKeySecret:'tAdbYQCmdur6jbZ8hjvgB7T1Z52mIG',
accessKeySecret: 'qHI7C3PaXYZySr84HTToviC71AYlFq',
//桶的名字 //桶的名字
bucket: 'zhuoqiu-image',
endpoint:'oss-cn-guangzhou.aliyuncs.com',
bucket: 'hanhaiimage',
endpoint: 'oss-cn-shenzhen.aliyuncs.com',
}); });
// 设置文件名和文件目录 // 设置文件名和文件目录
@ -41,7 +55,7 @@ function uploadFileToOSS(file) {
} }
}).then(res => { }).then(res => {
uni.hideLoading(); uni.hideLoading();
resolve('https://tennis-oss.xzaiyp.top/' + res.name);
resolve('https://image.hhlm1688.com/' + res.name);
}).catch(err => { }).catch(err => {
uni.hideLoading(); uni.hideLoading();
reject(err) reject(err)


BIN
service-uniapp-client/static/login/logo.png View File

Before After
Width: 505  |  Height: 504  |  Size: 154 KiB Width: 1000  |  Height: 1000  |  Size: 32 KiB

+ 70
- 0
service-uniapp-client/store/store.js View File

@ -0,0 +1,70 @@
import Vuex from 'vuex'
import api from '@/plugins/api.js'
import { handleTree } from '@/plugins/tree.js'
//Vuex.Store 构造器选项
const store = new Vuex.createStore({
state: {
configList: {}, //配置列表
userInfo : {}, //用户信息
areaList : [],//地区列表信息
selectArea : {},//当前选择的地区
},
getters: {
},
mutations: {
// 初始化配置
initConfig(state){
api('getConfig', {}, res => {
if(res.code == 200){
res.result.forEach(n => {
state.configList[n.keyValue] = n.content
})
}
// console.log("initConfig===============", res);
})
// let config = ['getPrivacyPolicy', 'getUserAgreement']
// config.forEach(k => {
// api(k, res => {
// if (res.code == 200) {
// state.configList[k] = res.result
// }
// })
// })
},
getUserInfo(state){
api('getInfo', {}, res => {
if(res.code == 200){
uni.setStorageSync('userInfo',JSON.stringify(res.result))
state.userInfo = res.result
}
})
},
// 退出登录
logout(state){
state.userInfo = {}
state.role = false
state.token = ""
uni.removeStorageSync('token')
},
// 查询地区
getArea(state, fn){
api('getCurrentArea', {}, res => {
if(res.code == 200){
state.areaList = handleTree(res.result, 'id', 'pid')
fn && fn(res.result)
state.selectArea = state.areaList[0].children[0].children[0]
}
})
},
setArea(state, selectArea){
state.selectArea = selectArea
},
},
actions: {},
})
export default store

+ 13
- 4
service-uniapp-client/utils/Share.js View File

@ -1,12 +1,14 @@
import api from '@/plugins/api.js' import api from '@/plugins/api.js'
import store from '../store/store'
function share() { //微信分享 function share() { //微信分享
//获取签名 //获取签名
let data = { let data = {
url: import.meta.env.VITE_REDIRECT_URI + '/#/' url: import.meta.env.VITE_REDIRECT_URI + '/#/'
} }
api('getVipShareSign', data, res => { api('getVipShareSign', data, res => {
if (res.code == 200) {
if (res.code == 200 && res.result) {
let { let {
appId, appId,
nonceStr, nonceStr,
@ -28,12 +30,14 @@ function share() { //微信分享
}); });
window.jWeixin.ready(function() { window.jWeixin.ready(function() {
// 微信分享的数据 // 微信分享的数据
var shareData = { var shareData = {
"link": addQueryParams(data.url), "link": addQueryParams(data.url),
"desc": "泰柔到家",
"title": "泰柔到家,温柔呵护每一刻!",
imgUrl : import.meta.env.VITE_REDIRECT_URI + '/static/share/logo.png',
"desc": store.state.configList.gs_name,
"title": store.state.configList.gs_name + "温柔呵护每一刻!",
imgUrl : store.state.configList.logo_image,
success: function() { success: function() {
//分享成功可以做相应的数据处理 //分享成功可以做相应的数据处理
// uni.showToast({ // uni.showToast({
@ -55,6 +59,11 @@ function share() { //微信分享
console.error(err); console.error(err);
// config信息验证失败会执行error函数,如签名过期导致验证失败,具体错误信息可以打开config的debug模式查看,也可以在返回的res参数中查看,对于SPA可以在这里更新签名。 // config信息验证失败会执行error函数,如签名过期导致验证失败,具体错误信息可以打开config的debug模式查看,也可以在返回的res参数中查看,对于SPA可以在这里更新签名。
}) })
}else{
uni.showToast({
title: '分享功能注册失败',
icon: 'none'
})
} }
}) })
} }


+ 3
- 3
service-uniapp-technician/.env View File

@ -1,13 +1,13 @@
# 开发环境 # 开发环境
#VITE_GLOB_API=http://h5.xzaiyp.top/massage-api
#VITE_GLOB_API=http://h5.xzaiyp.top/massage-api-tiandu
VITE_REDIRECT_URI=http://tairoudj.natapp1.cc VITE_REDIRECT_URI=http://tairoudj.natapp1.cc
# 生产环境 # 生产环境
VITE_GLOB_API=https://tai-testapi.sanhemovie.com/massage-api
#VITE_REDIRECT_URI=https://tai-testh5.sanhemovie.com
VITE_GLOB_API=https://admin.tiandufuwu.com/massage-api-tiandu
#VITE_REDIRECT_URI=https://technician.tiandufuwu.com

+ 1
- 1
service-uniapp-technician/manifest.json View File

@ -1,5 +1,5 @@
{ {
"name" : "秦柔到家",
"name" : "天都服务",
"appid" : "__UNI__A35F936", "appid" : "__UNI__A35F936",
"description" : "", "description" : "",
"versionName" : "1.0.0", "versionName" : "1.0.0",


+ 1
- 1
service-uniapp-technician/pages.json View File

@ -122,7 +122,7 @@
], ],
"globalStyle": { "globalStyle": {
"navigationBarTextStyle": "black", "navigationBarTextStyle": "black",
"navigationBarTitleText": "anmo.com",
"navigationBarTitleText": "天都服务",
"navigationBarBackgroundColor": "#F8F8F8", "navigationBarBackgroundColor": "#F8F8F8",
"backgroundColor": "#F8F8F8", "backgroundColor": "#F8F8F8",
"navigationStyle": "custom", "navigationStyle": "custom",


+ 22
- 7
service-uniapp-technician/plugins/upload.js View File

@ -19,14 +19,28 @@ function uploadFileToOSS(file) {
// endpoint:'oss-cn-shenzhen.aliyuncs.com' // endpoint:'oss-cn-shenzhen.aliyuncs.com'
//桶的地址 //桶的地址
region: 'oss-cn-guangzhou',
//id
accessKeyId:'LTAI5tNycA46YTwm383dRvMV',
// region: 'oss-cn-guangzhou',
// //id
// accessKeyId:'LTAI5tNycA46YTwm383dRvMV',
// //密钥
// accessKeySecret:'tAdbYQCmdur6jbZ8hjvgB7T1Z52mIG',
// //桶的名字
// bucket: 'zhuoqiu-image',
// endpoint:'oss-cn-guangzhou.aliyuncs.com',
/**
* 自己的
*/
//桶的地址
region: 'oss-cn-guangzhou',
//id
accessKeyId: 'LTAI5tQSs47izVy8DLVdwUU9',
//密钥 //密钥
accessKeySecret:'tAdbYQCmdur6jbZ8hjvgB7T1Z52mIG',
accessKeySecret: 'qHI7C3PaXYZySr84HTToviC71AYlFq',
//桶的名字 //桶的名字
bucket: 'zhuoqiu-image',
endpoint:'oss-cn-guangzhou.aliyuncs.com',
bucket: 'hanhaiimage',
endpoint: 'oss-cn-shenzhen.aliyuncs.com',
}); });
// 设置文件名和文件目录 // 设置文件名和文件目录
@ -41,7 +55,8 @@ function uploadFileToOSS(file) {
} }
}).then(res => { }).then(res => {
uni.hideLoading(); uni.hideLoading();
resolve('https://tennis-oss.xzaiyp.top/' + res.name);
// resolve('https://tennis-oss.xzaiyp.top/' + res.name);
resolve('https://image.hhlm1688.com/' + res.name);
}).catch(err => { }).catch(err => {
uni.hideLoading(); uni.hideLoading();
reject(err) reject(err)


Loading…
Cancel
Save