Browse Source

上传

master
前端-胡立永 6 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',
showLoading: true,
},
// 根据id获取景区详情
queryAreaListById: {
url: '/info/queryAreaListById',
method: 'GET',
showLoading: true,
},
// 根据id获取文章详情
queryArticleById: {
url: '/info/queryArticleById',
@ -178,6 +184,30 @@ const config = {
method: 'GET',
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)
}
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
class="main-image"
src="https://img-s-msn-com.akamaized.net/tenant/amp/entityid/BB1msKSi.img"
:src="area.areaImage"
mode="aspectFill"></image>
<view class="info">
<view class="title">
陶阳里景区
{{ area.areaName }}
</view>
<view class="tips">
6个遗产点
{{ spotGuide.length }}个遗产点
</view>
<view class="btn">
<image src="/static/image/tourGuide/a.png"
mode=""></image>
<text class=""
@click="textToSpeech">
@click="textToSpeech(area.areaBrief)">
语音讲解
</text>
</view>
@ -118,7 +119,7 @@
// }
import { mapState, mapGetters } from 'vuex'
export default {
props : ['spotGuide', 'spotGuideMarkers'],
props : ['spotGuide', 'spotGuideMarkers', 'area'],
data() {
return {
latitude: 23.106574, //
@ -126,7 +127,10 @@
scale: 12, //
show : true,
context : uni.createInnerAudioContext(),
tabs : ['文化遗产', '路径定制', '找厕所', '找美食', '找民宿'],
tabs : ['文化遗产',
// '',
'找厕所'
, '找美食', '找民宿'],
}
},
computed : {


+ 13
- 3
mixins/list.js View File

@ -1,8 +1,18 @@
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()
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)


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

@ -15,6 +15,7 @@
<locations
:spotGuide="spotGuide"
:spotGuideMarkers="spotGuideMarkers"
:area="area"
/>
<tabber select="1"/>
@ -36,26 +37,31 @@
// scale: 12, //
// bottomData: false,
// 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(){
},
computed: {
...mapGetters(['spotGuide', 'spotGuideMarkers']),
...mapState(['areaId', 'spotList']),
},
onShow() {
// this.mapCtx = wx.createMapContext('map');
@ -68,8 +74,18 @@
// console.log('fail', e);
// },
// });
this.queryAreaListById()
},
methods: {
queryAreaListById(){
this.$api('queryAreaListById', {
areaId : this.areaId
}, res => {
if(res.code == 200){
this.area = res.result
}
})
},
//
markertap(e) {
console.log("===你点击了标记点===", e)


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

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


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

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


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

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


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

@ -3,19 +3,20 @@
<navbar title="商品详情" leftClick @leftClick="$utils.navigateBack" />
<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 class="info">
<view class="title">
{{productDetailList.waresTitle}}
{{productDetail.waresTitle}}
</view>
<view class="info-line">
<view class="price">
<text>{{productDetailList.waresPrice}}</text>
<text>{{productDetail.waresPrice}}</text>
</view>
<view class="num">
{{productDetailList.waresSales}}
{{productDetail.waresSales}}
<image src="../static/product/like.png" mode=""></image>
</view>
</view>
@ -71,12 +72,8 @@
},
data() {
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) {
@ -99,7 +96,7 @@
res => {
if (res.code == 200) {
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>
<StudyAndPathDetailSubmit v-if="detail.isPay == 1"/>
</view>
</template>
@ -81,6 +82,13 @@
onShow() {
this.getData()
},
onShareAppMessage(res) {
return {
title: this.titles[this.type],
desc: this.detail.amusementTitle,
path: '/pages_order/service/StudyAndPathDetail?id=' + this.id
}
},
methods: {
//tab
clickTabs({index}) {


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

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


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

@ -12,7 +12,8 @@
{{ detail.roleName }}
</view>
<view class="left-list">
<view>
<view
@click="addCollection">
<button
class="share">
<uv-icon
@ -34,7 +35,7 @@
</button>
</view>
<view
@click="$refs.actionSheet.open()">
@click="$refs.contactActionSheet.open()">
<button
class="share">
<uv-icon
@ -116,11 +117,7 @@
</view>
<uv-action-sheet
ref="actionSheet"
:actions="actionSheet"
@select="select">
</uv-action-sheet>
<contactActionSheet ref="contactActionSheet"/>
<tabber/>
</view>
@ -128,27 +125,20 @@
<script>
import videoList from '@/components/list/videoList.vue'
import contactActionSheet from '@/components/base/contactActionSheet.vue'
export default {
components : {
videoList,
contactActionSheet,
},
data() {
return {
titles: ['遗产讲述', '达人同游', '我要跟拍'],
video_list_titles: ['讲解现场', '同游现场', '跟拍现场'],
collectType : [0, 1, 3],
type: 0,
id : 0,
detail : {},
actionSheet : [
{
name: '线上客服',
openType: 'contact'
},
{
name: '电话呼叫',
type : 'phone',
},
],
}
},
onLoad(args) {
@ -177,6 +167,16 @@
}
},
methods: {
addCollection(){
this.$api('addCollection', {
collectionItmeId : this.detail.id,
collectionType : this.collectType[this.type],
}, res => {
if(res.code == 200){
this.getData()
}
})
},
getData(){
this.$api('queryRoleInfoById', {
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){
uni.navigateTo({
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
v-for="(item,index) in list"
v-if="index > 1"
@click="toUrl(item.id)"
:key="index">
<image :src="item.areaImage" mode="aspectFill"/>
<view class="text">
@ -85,7 +86,7 @@
},
toUrl(id){
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){
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 true
})
},
@ -91,6 +94,9 @@ const store = new Vuex.Store({
setSpotGuideIndex(state, index){
state.spotGuideIndex = index
},
setAreaId(state, areaId){
state.areaId = areaId
},
// 获取所有页面的轮播图
getBanner(state){
@ -118,7 +124,7 @@ const store = new Vuex.Store({
res.result.records.forEach(n => {
if(n.spotLatitude && n.spotLongitude){
n.distance = 0,
n.distance = 0
spot.push(n)
}
})


Loading…
Cancel
Save