Browse Source

上传

master
前端-胡立永 10 months ago
parent
commit
04fa3f6c2d
14 changed files with 191 additions and 78 deletions
  1. +30
    -2
      api/api.js
  2. +47
    -0
      components/base/contactActionSheet.vue
  3. +12
    -8
      components/tourGuide/locations.vue
  4. +13
    -3
      mixins/list.js
  5. +29
    -13
      pages/index/tourGuide.vue
  6. +1
    -1
      pages_order/components/address/addressList.vue
  7. +8
    -1
      pages_order/components/submit/StudyAndPathDetailSubmit.vue
  8. +2
    -1
      pages_order/mine/address.vue
  9. +8
    -11
      pages_order/product/productDetail.vue
  10. +8
    -0
      pages_order/service/StudyAndPathDetail.vue
  11. +3
    -3
      pages_order/service/heritagePath.vue
  12. +17
    -29
      pages_order/service/reservationDetail.vue
  13. +2
    -1
      pages_order/service/situation.vue
  14. +11
    -5
      store/store.js

+ 30
- 2
api/api.js View File

@ -70,6 +70,12 @@ const config = {
method: 'GET', method: 'GET',
showLoading: true, showLoading: true,
}, },
// 根据id获取景区详情
queryAreaListById: {
url: '/info/queryAreaListById',
method: 'GET',
showLoading: true,
},
// 根据id获取文章详情 // 根据id获取文章详情
queryArticleById: { queryArticleById: {
url: '/info/queryArticleById', url: '/info/queryArticleById',
@ -178,6 +184,30 @@ const config = {
method: 'GET', method: 'GET',
showLoading: true, showLoading: true,
}, },
// 添加收藏
addCollection: {
url: '/user/addCollection',
method: 'POST',
showLoading: true,
},
// 获取收藏列表
queryCollectionList: {
url: '/user/queryCollectionList',
method: 'GET',
showLoading: true,
},
// 添加购物车
addShopcar: {
url: '/user/addShopcar',
method: 'POST',
showLoading: true,
},
// 获取购物车列表
queryShopcarList: {
url: '/user/queryShopcarList',
method: 'GET',
showLoading: true,
},
@ -279,6 +309,4 @@ export function api(key, data, callback, loadingTitle) {
loadingTitle || req.showLoading, loadingTitle || req.loadingTitle) loadingTitle || req.showLoading, loadingTitle || req.loadingTitle)
} }
export default api export default api

+ 47
- 0
components/base/contactActionSheet.vue View File

@ -0,0 +1,47 @@
<template>
<uv-action-sheet
ref="actionSheet"
:actions="actionSheet"
@select="select">
</uv-action-sheet>
</template>
<script>
export default {
data() {
return {
actionSheet : [
{
name: '线上客服',
openType: 'contact'
},
{
name: '电话呼叫',
type : 'phone',
},
],
}
},
methods: {
select(e){
if(e.type == 'phone'){
uni.makePhoneCall({
// 12345 this.mobile
phoneNumber: '123',
//
success: (res) => {
console.log('调用成功!')
},
})
}
},
open(){
this.$refs.actionSheet.open()
}
}
}
</script>
<style>
</style>

+ 12
- 8
components/tourGuide/locations.vue View File

@ -25,25 +25,26 @@
<!-- '文化遗产', '找厕所', '找美食', '找民宿' --> <!-- '文化遗产', '找厕所', '找美食', '找民宿' -->
<view class="Locations-list" v-if="spotGuideIndex != 1">
<view class="main" v-if="spotGuideIndex == 0">
<!-- v-if="spotGuideIndex != 1" -->
<view class="Locations-list">
<view class="main" v-if="spotGuideIndex == 0 && area">
<image <image
class="main-image" class="main-image"
src="https://img-s-msn-com.akamaized.net/tenant/amp/entityid/BB1msKSi.img"
:src="area.areaImage"
mode="aspectFill"></image> mode="aspectFill"></image>
<view class="info"> <view class="info">
<view class="title"> <view class="title">
陶阳里景区
{{ area.areaName }}
</view> </view>
<view class="tips"> <view class="tips">
6个遗产点
{{ spotGuide.length }}个遗产点
</view> </view>
<view class="btn"> <view class="btn">
<image src="/static/image/tourGuide/a.png" <image src="/static/image/tourGuide/a.png"
mode=""></image> mode=""></image>
<text class="" <text class=""
@click="textToSpeech">
@click="textToSpeech(area.areaBrief)">
语音讲解 语音讲解
</text> </text>
</view> </view>
@ -118,7 +119,7 @@
// } // }
import { mapState, mapGetters } from 'vuex' import { mapState, mapGetters } from 'vuex'
export default { export default {
props : ['spotGuide', 'spotGuideMarkers'],
props : ['spotGuide', 'spotGuideMarkers', 'area'],
data() { data() {
return { return {
latitude: 23.106574, // latitude: 23.106574, //
@ -126,7 +127,10 @@
scale: 12, // scale: 12, //
show : true, show : true,
context : uni.createInnerAudioContext(), context : uni.createInnerAudioContext(),
tabs : ['文化遗产', '路径定制', '找厕所', '找美食', '找民宿'],
tabs : ['文化遗产',
// '',
'找厕所'
, '找美食', '找民宿'],
} }
}, },
computed : { computed : {


+ 13
- 3
mixins/list.js View File

@ -1,8 +1,18 @@
function query(self, queryParams){ function query(self, queryParams){
return (self.beforeGetData && self.beforeGetData()) ||
queryParams || self.queryParams
// return (self.beforeGetData && self.beforeGetData()) ||
// queryParams || self.queryParams
// 深度合并对象
return self.$utils.deepMergeObject(
self.$utils.deepMergeObject(self.queryParams,
(self.beforeGetData && self.beforeGetData()) || {}),
queryParams)
} }
@ -31,7 +41,7 @@ export default {
uni.stopPullDownRefresh() uni.stopPullDownRefresh()
if(res.code == 200){ if(res.code == 200){
this.getDataThen && this.getDataThen(res.result)
this.getDataThen && this.getDataThen(res.result.records, res.result.total, res.result)
success(res.result) success(res.result)


+ 29
- 13
pages/index/tourGuide.vue View File

@ -15,6 +15,7 @@
<locations <locations
:spotGuide="spotGuide" :spotGuide="spotGuide"
:spotGuideMarkers="spotGuideMarkers" :spotGuideMarkers="spotGuideMarkers"
:area="area"
/> />
<tabber select="1"/> <tabber select="1"/>
@ -36,26 +37,31 @@
// scale: 12, // // scale: 12, //
// bottomData: false, // bottomData: false,
// mapCtx: null, // mapCtx: null,
markers:[
// { //A
// iconPath: "/static/logo.png", //
// id: 0,
// width: 20, //icon
// height: 28 ,//icon
// latitude: 26.1272,
// longitude: 113.11659
// }
],
// markers:[
// // { //A
// // iconPath: "/static/logo.png", //
// // id: 0,
// // width: 20, //icon
// // height: 28 ,//icon
// // latitude: 26.1272,
// // longitude: 113.11659
// // }
// ],
area : [],
} }
}, },
onLoad() {
// this.$store.commit('')
onLoad(args) {
if(args.areaId){
this.$store.commit('setAreaId', args.areaId)
}else{
this.$store.commit('setAreaId', this.spotList[0].areaId)
}
}, },
onShow(){ onShow(){
}, },
computed: { computed: {
...mapGetters(['spotGuide', 'spotGuideMarkers']), ...mapGetters(['spotGuide', 'spotGuideMarkers']),
...mapState(['areaId', 'spotList']),
}, },
onShow() { onShow() {
// this.mapCtx = wx.createMapContext('map'); // this.mapCtx = wx.createMapContext('map');
@ -68,8 +74,18 @@
// console.log('fail', e); // console.log('fail', e);
// }, // },
// }); // });
this.queryAreaListById()
}, },
methods: { methods: {
queryAreaListById(){
this.$api('queryAreaListById', {
areaId : this.areaId
}, res => {
if(res.code == 200){
this.area = res.result
}
})
},
// //
markertap(e) { markertap(e) {
console.log("===你点击了标记点===", e) console.log("===你点击了标记点===", e)


+ 1
- 1
pages_order/components/address/addressList.vue View File

@ -95,7 +95,7 @@
this.addressList = res.result.records || []; this.addressList = res.result.records || [];
this.total = res.result.total || 0; this.total = res.result.total || 0;
this.addressList.forEach(n => { // this.addressList.forEach(n => { //
if (n.defaultId == '1') {
if (n.addressDefault == '1') {
this.selectAddress = n.id this.selectAddress = n.id
} }
}) })


+ 8
- 1
pages_order/components/submit/StudyAndPathDetailSubmit.vue View File

@ -2,7 +2,7 @@
<view class="submit"> <view class="submit">
<view class="" <view class=""
@click=""
@click="$refs.contactActionSheet.open()"
v-if="!article"> v-if="!article">
<button <button
class="share"> class="share">
@ -64,11 +64,18 @@
@click="$emit('submit')"> @click="$emit('submit')">
{{ submiitTitle }} {{ submiitTitle }}
</view> </view>
<contactActionSheet ref="contactActionSheet"/>
</view> </view>
</template> </template>
<script> <script>
import contactActionSheet from '@/components/base/contactActionSheet.vue'
export default { export default {
components : {
contactActionSheet,
},
name:"submit", name:"submit",
props : { props : {
submiitTitle : { submiitTitle : {


+ 2
- 1
pages_order/mine/address.vue View File

@ -93,8 +93,9 @@
// //
editDefault(id) { editDefault(id) {
this.$api('addressDefault', {
this.$api('updateAddress', {
id: id, id: id,
addressDefault : 1,
}, res => { }, res => {
if (res.code == 200) { if (res.code == 200) {
this.$refs.addressPopup.close() this.$refs.addressPopup.close()


+ 8
- 11
pages_order/product/productDetail.vue View File

@ -3,19 +3,20 @@
<navbar title="商品详情" leftClick @leftClick="$utils.navigateBack" /> <navbar title="商品详情" leftClick @leftClick="$utils.navigateBack" />
<view class="swipe"> <view class="swipe">
<uv-swiper :list="productDetailList.waresImage.split(',')" indicator height="350rpx"></uv-swiper>
<uv-swiper :list="productDetail.waresImage &&
productDetail.waresImage.split(',')" indicator height="420rpx"></uv-swiper>
</view> </view>
<view class="info"> <view class="info">
<view class="title"> <view class="title">
{{productDetailList.waresTitle}}
{{productDetail.waresTitle}}
</view> </view>
<view class="info-line"> <view class="info-line">
<view class="price"> <view class="price">
<text>{{productDetailList.waresPrice}}</text>
<text>{{productDetail.waresPrice}}</text>
</view> </view>
<view class="num"> <view class="num">
{{productDetailList.waresSales}}
{{productDetail.waresSales}}
<image src="../static/product/like.png" mode=""></image> <image src="../static/product/like.png" mode=""></image>
</view> </view>
</view> </view>
@ -71,12 +72,8 @@
}, },
data() { data() {
return { return {
productDetail: {
image: 'https://cdn.uviewui.com/uview/swiper/swiper3.png,https://cdn.uviewui.com/uview/swiper/swiper2.png',
content: '',
productId: '',
productDetailList:''
},
productDetail: {},
productId : 0,
} }
}, },
onLoad(args) { onLoad(args) {
@ -99,7 +96,7 @@
res => { res => {
if (res.code == 200) { if (res.code == 200) {
console.log(res); console.log(res);
this.productDetailList = res.result
this.productDetail = res.result
} }
}) })
} }


+ 8
- 0
pages_order/service/StudyAndPathDetail.vue View File

@ -43,6 +43,7 @@
</view> </view>
</view> </view>
<StudyAndPathDetailSubmit v-if="detail.isPay == 1"/> <StudyAndPathDetailSubmit v-if="detail.isPay == 1"/>
</view> </view>
</template> </template>
@ -81,6 +82,13 @@
onShow() { onShow() {
this.getData() this.getData()
}, },
onShareAppMessage(res) {
return {
title: this.titles[this.type],
desc: this.detail.amusementTitle,
path: '/pages_order/service/StudyAndPathDetail?id=' + this.id
}
},
methods: { methods: {
//tab //tab
clickTabs({index}) { clickTabs({index}) {


+ 3
- 3
pages_order/service/heritagePath.vue View File

@ -54,7 +54,6 @@
return { return {
isShow: 0, isShow: 0,
mixinsListApi : 'queryAmusementList', mixinsListApi : 'queryAmusementList',
list : [],
} }
}, },
computed : { computed : {
@ -73,8 +72,9 @@
this.getData() this.getData()
}, },
// //
getDataThen(result){
this.list.forEach(n => n.amusementImage =
getDataThen(list){
list.forEach(n => n.amusementImage =
n.amusementImage ? n.amusementImage ?
n.amusementImage.split(',') : []) n.amusementImage.split(',') : [])
}, },


+ 17
- 29
pages_order/service/reservationDetail.vue View File

@ -12,7 +12,8 @@
{{ detail.roleName }} {{ detail.roleName }}
</view> </view>
<view class="left-list"> <view class="left-list">
<view>
<view
@click="addCollection">
<button <button
class="share"> class="share">
<uv-icon <uv-icon
@ -34,7 +35,7 @@
</button> </button>
</view> </view>
<view <view
@click="$refs.actionSheet.open()">
@click="$refs.contactActionSheet.open()">
<button <button
class="share"> class="share">
<uv-icon <uv-icon
@ -116,11 +117,7 @@
</view> </view>
<uv-action-sheet
ref="actionSheet"
:actions="actionSheet"
@select="select">
</uv-action-sheet>
<contactActionSheet ref="contactActionSheet"/>
<tabber/> <tabber/>
</view> </view>
@ -128,27 +125,20 @@
<script> <script>
import videoList from '@/components/list/videoList.vue' import videoList from '@/components/list/videoList.vue'
import contactActionSheet from '@/components/base/contactActionSheet.vue'
export default { export default {
components : { components : {
videoList, videoList,
contactActionSheet,
}, },
data() { data() {
return { return {
titles: ['遗产讲述', '达人同游', '我要跟拍'], titles: ['遗产讲述', '达人同游', '我要跟拍'],
video_list_titles: ['讲解现场', '同游现场', '跟拍现场'], video_list_titles: ['讲解现场', '同游现场', '跟拍现场'],
collectType : [0, 1, 3],
type: 0, type: 0,
id : 0, id : 0,
detail : {}, detail : {},
actionSheet : [
{
name: '线上客服',
openType: 'contact'
},
{
name: '电话呼叫',
type : 'phone',
},
],
} }
}, },
onLoad(args) { onLoad(args) {
@ -177,6 +167,16 @@
} }
}, },
methods: { methods: {
addCollection(){
this.$api('addCollection', {
collectionItmeId : this.detail.id,
collectionType : this.collectType[this.type],
}, res => {
if(res.code == 200){
this.getData()
}
})
},
getData(){ getData(){
this.$api('queryRoleInfoById', { this.$api('queryRoleInfoById', {
roleInfoId : this.id, roleInfoId : this.id,
@ -187,18 +187,6 @@
} }
}) })
}, },
select(e){
if(e.type == 'phone'){
uni.makePhoneCall({
// 12345 this.mobile
phoneNumber: '123',
//
success: (res) => {
console.log('调用成功!')
},
})
}
},
toUrl(detail, type){ toUrl(detail, type){
uni.navigateTo({ uni.navigateTo({
url: `/pages_order/order/orderSubscribe?id=${detail.id}&payType=${parseInt(type) + 1}` url: `/pages_order/order/orderSubscribe?id=${detail.id}&payType=${parseInt(type) + 1}`


+ 2
- 1
pages_order/service/situation.vue View File

@ -33,6 +33,7 @@
<view <view
v-for="(item,index) in list" v-for="(item,index) in list"
v-if="index > 1" v-if="index > 1"
@click="toUrl(item.id)"
:key="index"> :key="index">
<image :src="item.areaImage" mode="aspectFill"/> <image :src="item.areaImage" mode="aspectFill"/>
<view class="text"> <view class="text">
@ -85,7 +86,7 @@
}, },
toUrl(id){ toUrl(id){
uni.navigateTo({ uni.navigateTo({
url: '/pages/index/tourGuide?id=' + id
url: '/pages/index/tourGuide?areaId=' + id
}) })
}, },
} }


+ 11
- 5
store/store.js View File

@ -41,14 +41,17 @@ const store = new Vuex.Store({
spotGuide(state){ spotGuide(state){
return state.spotList.filter(n => { return state.spotList.filter(n => {
let i = state.spotGuideIndex < 2 ?
0 : state.spotGuideIndex - 1
// let i = state.spotGuideIndex < 2 ?
// 0 : state.spotGuideIndex - 1
console.log(i);
if(state.spotGuideIndex != n.categoryId){
return false
}
if(i != n.categoryId){
if(state.areaId != n.areaId){
return false return false
} }
return true return true
}) })
}, },
@ -91,6 +94,9 @@ const store = new Vuex.Store({
setSpotGuideIndex(state, index){ setSpotGuideIndex(state, index){
state.spotGuideIndex = index state.spotGuideIndex = index
}, },
setAreaId(state, areaId){
state.areaId = areaId
},
// 获取所有页面的轮播图 // 获取所有页面的轮播图
getBanner(state){ getBanner(state){
@ -118,7 +124,7 @@ const store = new Vuex.Store({
res.result.records.forEach(n => { res.result.records.forEach(n => {
if(n.spotLatitude && n.spotLongitude){ if(n.spotLatitude && n.spotLongitude){
n.distance = 0,
n.distance = 0
spot.push(n) spot.push(n)
} }
}) })


Loading…
Cancel
Save