zhengkaixin 1 年之前
父節點
當前提交
cf53bccd40
共有 5 個文件被更改,包括 122 次插入17 次删除
  1. 1 1
      .env.dev.js
  2. 1 1
      pages/index/index.vue
  3. 72 3
      pages/store/51store.vue
  4. 5 2
      pages/store/commodityDetails.vue
  5. 43 10
      pages/store/orderConfirm.vue

+ 1 - 1
.env.dev.js

@@ -2,7 +2,7 @@ const UNI_APP = {
 	ProjectName :"51充电联盟",
 	BASE_URL: 'https://51team.xiaoxinda.com/charging-station-server/',
 	//
-	BASE_URL: 'https://charging.xiaoxinda.com/charging-station-test/',
+	//BASE_URL: 'https://charging.xiaoxinda.com/charging-station-test/',
 
 	//BASE_URL: 'http://192.168.77.162:8081/charging-station/' ,
 	//PARK_URL: 'http://192.168.11.120:8082/charging-parking/' ,

+ 1 - 1
pages/index/index.vue

@@ -936,7 +936,7 @@
 		},
 		methods: {
 			gotoArticleDetails(item) {
-				debugger
+				
 				if (item.linkType == "2") {
 					this.gotoUrl2(item.externalUrl)
 

+ 72 - 3
pages/store/51store.vue

@@ -2,10 +2,20 @@
 	<view>
 		<ujp-navbar title="51商城"></ujp-navbar>
 		<!-- 广告-->
+		<!-- <view class="banner">
+			
+			
+		</view> -->
+		
 		<view class="banner">
 			
-			<img src="../../assets/img/storeBanner1.png" alt="">
+			<u-swiper bg-color="#fff" v-if="bannerList.length"
+			:img-mode="'scaleToFill'" :list="bannerList" @click="clickBanner"
+				:name="'picUrl'">
+			</u-swiper>
+			<img src="../../assets/img/storeBanner1.png" alt="" v-else >
 			
+		
 		</view>
 		<!-- 标签 -->
 		<!-- <view class="banner2">
@@ -58,18 +68,20 @@
 
 <script>
 	import * as API from '@/apis/mall.js'
-	
+	import * as newsApi from '@/apis/news.js'
 	export default {
 		data() {
 			return {
 				mallList:[],
-			
+				bannerList: [],
 				pageIndex: 1,
 				recordsTotal: 0,
 			}
 		},
 		onReady() {
 			this.getList()
+			this.getBannerInfo("store");
+			
 			
 		},
 		onReachBottom() {
@@ -78,6 +90,63 @@
 			}
 		},
 		methods: {
+			clickBanner(index, bl, modout) {
+				var uurl = "";
+				var mod = this.bannerList[index]
+				if (modout) {
+					mod = modout;
+				}
+				mod.clickUrl = mod.linkUrl
+			
+				if (mod.linkPicUrl && !bl) {
+			
+					this.showOss = true;
+					this.showOssImg = mod.linkPicUrl;
+					this.showOssIndex = index;
+			
+				} else if (mod.clickUrl == null) {
+			
+				} else if (mod.clickUrl.indexOf('http') == 0) {
+			
+					window.location = mod.clickUrl + uurl;
+				} else if (mod.clickUrl.slice(-5) == 'login' && this.userId) {
+			
+				} else if (mod.clickUrl.indexOf('#/') == 0) {
+					if (mod.clickUrl.indexOf("?") == -1) {
+						mod.clickUrl += '?';
+					}
+					var url = mod.clickUrl.split("#")[1]
+					//window.location = mod.clickUrl;
+					uni.navigateTo({
+						url: url + uurl
+					})
+				} else if (mod.clickUrl == '#' || mod.clickUrl == '') {
+			
+				} else {
+					uni.navigateTo({
+						url: mod.clickUrl + uurl
+					})
+				}
+			},
+			getBannerInfo(code, list) {
+			
+				newsApi.getBannerInfo(code).then((res) => {
+					if (list) {
+						this[list] = res.data;
+					} else {
+						this.bannerList = res.data;
+					}
+			
+					//uni.hideLoading()
+					//document.getElementsByClassName("uni-swiper-wrapper")[0].parentNode.style="background-color: rgb(255, 255, 255); height: 120px;"
+				}).catch(error => {
+					uni.showToast({
+			
+						title: error,
+						icon: "none"
+					})
+				})
+			},
 			myLoadmore(){
 				this.pageIndex += 1;
 				this.getList()

+ 5 - 2
pages/store/commodityDetails.vue

@@ -692,7 +692,7 @@
 			
 				    background-color: #8D8072;
 				    color: #fff;
-				    padding: 0 4px;
+				    padding: 2px 6px;
 				    border-radius: 15px;
 				    font-size: 10px;
 			}
@@ -717,7 +717,10 @@
 			}
 			// 被选中的
 			.item-chosen{
-				border: 1px solid #53b56b;
+				
+				    border: 1px solid #53b56b;
+				    background-color: #53b56b;
+				    color: #fff;
 			}
 		}
 		

+ 43 - 10
pages/store/orderConfirm.vue

@@ -42,14 +42,14 @@
 					湖北省荆州市沙市区朝阳街道
 				</view>
 				<view class="address2">
-					{{deliveryAddress?deliveryAddress:'未填写地址'}}
+					{{deliveryAddress?deliveryAddress:'未填写详细地址'}}
 				</view>
 				<view class="infos">
 					<view class="name">
-						{{receiver?receiver:'未填写姓名'}}
+						{{receiver?receiver:'未填写收货人姓名'}}
 					</view>
 					<view class="tel">
-						  {{contactPhone?contactPhone:'未填写手机号'}}
+						  {{contactPhone?contactPhone:'未填写收货人手机号'}}
 					</view>
 				</view>
 			</view>
@@ -210,9 +210,9 @@
 					<view class="infos">
 						<view class="item">
 							<view class="item-title">
-								收
+								收
 							</view>
-							<view class="item-value">
+							<view class="item-value"  style="border-bottom: 1px solid #9E9E9E;">
 								<input type="text"  v-model="receiverTemp" placeholder="请输入收货人姓名">
 							</view>
 						</view>
@@ -220,7 +220,7 @@
 							<view class="item-title">
 								手机号码
 							</view>
-							<view class="item-value">
+							<view class="item-value"   style="border-bottom: 1px solid #9E9E9E;">
 								<input type="text"  v-model="contactPhoneTemp" placeholder="请输入收货人手机号">
 							</view>
 						</view>
@@ -228,7 +228,7 @@
 							<view class="item-title">
 								所在区域
 							</view>
-							<view class="item-value">
+							<view class="item-value"  style="border: 1px solid #9E9E9E;">
 								<input type="text" placeholder="请选择省/市/区">
 								
 							</view>
@@ -250,9 +250,9 @@
 							</view>
 							
 						</view>
-						<view class="item">
+						<view class="item" style="border: 1px solid #9E9E9E;">
 							
-							<u-input  type="textarea"  placeholder="请输入街道地址" v-model="deliveryAddressTemp">
+							<u-input  type="textarea"  placeholder="请输入详细地址" v-model="deliveryAddressTemp">
 							</u-input>
 							
 						</view>
@@ -289,9 +289,10 @@
 	} from '@/utils/wxpay'
 	import QRCode from 'qrcodejs2'
 	import {
-		newDate,
+		newDate,checkPhone,
 		convertCanvasToImage,
 	} from '@/utils'
+
 import MapLoader from '@/utils/AMap'
 	export default {
 		data() {
@@ -417,6 +418,38 @@ import MapLoader from '@/utils/AMap'
 			},
 			submit(){
 				var type=this.submitType
+				if(!this.receiver){
+					uni.showToast({
+								
+						title: "请输入收货人姓名"
+					})
+					return
+				}
+				if(!this.contactPhone){
+					uni.showToast({
+								
+						title: "请输入收货人手机号码"
+					})
+					return
+				}
+				
+				var checkPhoneResult = checkPhone(this.contactPhone);
+				
+				if (checkPhoneResult !== true) {
+					uni.showToast({
+						title: checkPhoneResult,
+					})
+					return;
+				}
+				
+				if(!this.deliveryAddress){
+					uni.showToast({
+								
+						title: "请输入详细地址"
+					})
+					return
+				}
+				
 				if (type == 0) {
 					this.wxpy()
 				}