ソースを参照

style:收获地址布局改动

qianxinyu 4 ヶ月 前
コミット
795d984404
5 ファイル変更156 行追加118 行削除
  1. 93 91
      App.vue
  2. 29 15
      pages/addr/index.vue
  3. 9 6
      pages/car/order.vue
  4. 8 4
      pages/product/index.vue
  5. 17 2
      pages/score/product.vue

+ 93 - 91
App.vue

@@ -1,104 +1,106 @@
 <script>
-	export default {
-		data() {
-			return {
-				getOn:true,
-				globalData:{
-					shareList:[],
-				}
-			}
-		},
-		onLaunch: function(param) {
-			
-		},
-		onShow: function() {
-			// #ifdef MP
-			// 检查是否升级
-			this.checkForUpdate();
-			// #endif
-			// 进入小程序,如果需要推送客服,请求客户信息,获取最新的微伴ID
-			if( this.$checkAccess.getFollowQrcode() ){
-				if( !this.getOn )  return ;
-				this.getOn = false;
-				// 判断数据
-				this.$http.request('api/custom/get_info').then((callback)=>{
-					this.getOn = true;
-					if( callback.code == 'success' ){
-						if( !callback.data.userpic ) callback.data.userpic = "../../static/icon/doctor.png";
-						// 赋值
-						this.userInfo = callback.data;
-						// 存储登录标识
-						uni.setStorageSync('userInfo',callback.data);
-					}
-				});
+export default {
+	data() {
+		return {
+			getOn: true,
+			globalData: {
+				shareList: []
 			}
+		};
+	},
+	onLaunch: function (param) {},
+	onShow: function () {
+		// #ifdef MP
+		// 检查是否升级
+		this.checkForUpdate();
+		// #endif
+		// 进入小程序,如果需要推送客服,请求客户信息,获取最新的微伴ID
+		if (this.$checkAccess.getFollowQrcode()) {
+			if (!this.getOn) return;
+			this.getOn = false;
 			// 判断数据
-			this.$http.request('/api/share_message/get_list').then((callback)=>{
-				if( callback.code == 'success' ){
+			this.$http.request('api/custom/get_info').then((callback) => {
+				this.getOn = true;
+				if (callback.code == 'success') {
+					if (!callback.data.userpic) callback.data.userpic = '../../static/icon/doctor.png';
 					// 赋值
-					getApp().globalData.shareList = callback.data;
+					this.userInfo = callback.data;
+					// 存储登录标识
+					uni.setStorageSync('userInfo', callback.data);
 				}
 			});
-			
-		},
-		onHide: function() {
-			console.log('App Hide');
-		},
-		methods:{
-			// 检查是否升级
-			checkForUpdate(){
-				const _this = this; 
-				// 获取升级管理实例
-				const updateManager = uni.getUpdateManager();
-				// 请求版本回调
-				updateManager.onCheckForUpdate(function(res){
-					console.log(res);
-					// 如果有版本升级
-					if( res && res.hasUpdate ){
-						uni.showModal({
-							title:"更新提示",
-							content:"检测到新版,点击确认升级程序",
-							showCancel:false,
-							success(res){
-								if(res.confirm){
-									uni.showLoading({title:"程序更新中"});
-									// 判断是否准备好升级
-									updateManager.onUpdateReady(function(res){
-										// 关闭加载
-										uni.hideLoading();
-										// 当新版本下载完成,调用该方法会强制当前uni-app应用上新版本并重启
-										updateManager.applyUpdate();
-									})
-									updateManager.onUpdateFailed(function(err){
-										// 关闭加载
-										uni.hideLoading();
-									})
-								}
-							}
-						})
-					}
-				})
-				
+		}
+		// 判断数据
+		this.$http.request('/api/share_message/get_list').then((callback) => {
+			if (callback.code == 'success') {
+				// 赋值
+				getApp().globalData.shareList = callback.data;
 			}
+		});
+	},
+	onHide: function () {
+		console.log('App Hide');
+	},
+	methods: {
+		// 检查是否升级
+		checkForUpdate() {
+			const _this = this;
+			// 获取升级管理实例
+			const updateManager = uni.getUpdateManager();
+			// 请求版本回调
+			updateManager.onCheckForUpdate(function (res) {
+				console.log(res);
+				// 如果有版本升级
+				if (res && res.hasUpdate) {
+					uni.showModal({
+						title: '更新提示',
+						content: '检测到新版,点击确认升级程序',
+						showCancel: false,
+						success(res) {
+							if (res.confirm) {
+								uni.showLoading({ title: '程序更新中' });
+								// 判断是否准备好升级
+								updateManager.onUpdateReady(function (res) {
+									// 关闭加载
+									uni.hideLoading();
+									// 当新版本下载完成,调用该方法会强制当前uni-app应用上新版本并重启
+									updateManager.applyUpdate();
+								});
+								updateManager.onUpdateFailed(function (err) {
+									// 关闭加载
+									uni.hideLoading();
+								});
+							}
+						}
+					});
+				}
+			});
 		}
 	}
+};
 </script>
 
 <style lang="less">
-	/*每个页面公共css */
-	page{
-		font-family: Arial, Helvetica, sans-serif;
-		background: #F5F5F5;
-	}
-	// 到底了
-	.to_bottom{
-		height: 40rpx;
-		color: #999999;
-		display: block;
-		font-size: 20rpx;
-		margin-top: 20rpx;
-		line-height: 40rpx;
-		text-align: center;
-		padding-bottom: 160rpx;
-	}
+/*每个页面公共css */
+page {
+	font-family: Arial, Helvetica, sans-serif;
+	background: #f5f5f5;
+}
+// 到底了
+.to_bottom {
+	height: 40rpx;
+	color: #999999;
+	display: block;
+	font-size: 20rpx;
+	margin-top: 20rpx;
+	line-height: 40rpx;
+	text-align: center;
+	padding-bottom: 160rpx;
+}
+
+.text-ellipsis {
+	white-space: nowrap; /* 不换行 */
+	overflow: hidden; /* 超出内容隐藏 */
+	text-overflow: ellipsis; /* 超出内容用省略号显示 */
+}
 </style>

+ 29 - 15
pages/addr/index.vue

@@ -3,15 +3,17 @@
 		<view class="to_bottom" v-if="!addrList.length">-----还没有地址啦-----</view>
 		<view class="addr_list">
 			<view class="addr_item" v-for="(item, index) in addrList" :key="index">
-				<view class="contact_user">
-					<text class="contact_name">{{ item.contact_name }}</text>
-					<text class="contact_phone">{{ item.contact_phone }}</text>
-					<text class="contact_shop">{{ item.contact_shop }}</text>
-				</view>
-				<view class="contact_addr" style="display: flex">
-					{{ item.contact_province }} {{ item.contact_city }} {{ item.contact_area }} {{ item.contact_addr }}
-					<view v-if="item.shop_type">&nbsp;({{ $CONSTANTS.SHOP_TYPES[item.shop_type] }})</view>
+				<view class="contact_user" style="display: flex; justify-content: space-between; width: 100%">
+					<view style="display: flex">
+						<text class="contact_name">{{ item.contact_name }}</text>
+						<text class="contact_phone">{{ item.contact_phone }}</text>
+					</view>
+					<view class="contact_shop text-ellipsis" style="width: 250rpx; text-align: end">
+						<text v-if="item.shop_type">({{ $CONSTANTS.SHOP_TYPES[item.shop_type] }})&nbsp;</text>
+						{{ item.contact_shop }}
+					</view>
 				</view>
+				<view class="contact_addr">{{ item.contact_province }} {{ item.contact_city }} {{ item.contact_area }} {{ item.contact_addr }}</view>
 				<view class="contact_handler">
 					<view class="radio_label" @click="setDefault(index)">
 						<image class="radio_icon" :src="item.is_default ? '../../static/icon/radioed.png' : '../../static/icon/radio.png'"></image>
@@ -51,11 +53,17 @@
 					<view class="form_group">
 						<view class="group_title">终端类型:</view>
 						<view class="group_box">
-							<radio-group @change="handleRadioChange" class="terminalType_radio">
-								<block v-for="item in terminalType" :key="item.key">
-									<radio :value="item.key" :checked="item.key === addrRequest.shop_type">{{ item.label }}</radio>
-								</block>
-							</radio-group>
+							<view class="terminalType_radio">
+								<view v-for="item in terminalType" :key="item.key">
+									<view style="display: flex; align-items: center" @click="handleRadioChange(item.key)">
+										<image
+											class="radio_icon"
+											:src="item.key === addrRequest.shop_type ? '../../static/icon/radioed.png' : '../../static/icon/radio.png'"
+										></image>
+										&nbsp;{{ item.label }}
+									</view>
+								</view>
+							</view>
 						</view>
 					</view>
 					<view class="form_group">
@@ -315,8 +323,9 @@ export default {
 				if (this.AddrEmit) uni.$emit('addr_list_change', { list: this.addrList });
 			});
 		},
-		handleRadioChange(event) {
-			this.addrRequest.shop_type = Number(event.detail.value);
+		handleRadioChange(key) {
+			console.log(key);
+			this.addrRequest.shop_type = Number(key);
 		}
 	}
 };
@@ -433,6 +442,11 @@ export default {
 				float: left;
 				width: 480rpx;
 				display: block;
+				.radio_icon {
+					width: 50rpx;
+					height: 50rpx;
+					vertical-align: middle;
+				}
 				.form_ctrl {
 					height: 56rpx;
 					font-size: 24rpx;

+ 9 - 6
pages/car/order.vue

@@ -6,12 +6,14 @@
 				<text class="contact_name">{{ checkedAddr.contact_name }}</text>
 				<text class="contact_phone">{{ checkedAddr.contact_phone }}</text>
 				<text class="contact_more">&gt;</text>
-				<text class="contact_shop">{{ checkedAddr.contact_shop }}</text>
+				<view class="contact_shop text-ellipsis" style="width: 250rpx; text-align: end">
+					<text v-if="checkedAddr.shop_type">({{ $CONSTANTS.SHOP_TYPES[checkedAddr.shop_type] }})&nbsp;</text>
+					{{ checkedAddr.contact_shop }}
+				</view>
 			</view>
 			<view class="contact_addr" style="display: flex">
 				{{ checkedAddr.contact_province }} {{ checkedAddr.contact_city }} {{ checkedAddr.contact_area }}
 				{{ checkedAddr.contact_addr }}
-				<view v-if="checkedAddr.shop_type">&nbsp;({{ $CONSTANTS.SHOP_TYPES[checkedAddr.shop_type] }})</view>
 			</view>
 		</view>
 		<view class="car_list">
@@ -122,11 +124,12 @@
 						<text class="contact_name">{{ item.contact_name }}</text>
 						<text class="contact_phone">{{ item.contact_phone }}</text>
 						<text class="contact_default" v-if="item.is_default">默认</text>
+						<view class="contact_shop text-ellipsis" style="width: 250rpx; text-align: end">
+							<text v-if="item.shop_type">({{ $CONSTANTS.SHOP_TYPES[item.shop_type] }})&nbsp;</text>
+							{{ item.contact_shop }}
+						</view>
 					</view>
-					<view class="contact_addr" style="display: flex">
-						{{ item.contact_province }} {{ item.contact_city }} {{ item.contact_area }} {{ item.contact_addr }}
-						<view v-if="item.shop_type">&nbsp;({{ $CONSTANTS.SHOP_TYPES[item.shop_type] }})</view>
-					</view>
+					<view class="contact_addr" style="display: flex">{{ item.contact_province }} {{ item.contact_city }} {{ item.contact_area }} {{ item.contact_addr }}</view>
 				</view>
 			</view>
 			<view class="create_box">

+ 8 - 4
pages/product/index.vue

@@ -118,12 +118,14 @@
 						<text class="contact_name">{{checkedAddr.contact_name}}</text>
 						<text class="contact_phone">{{checkedAddr.contact_phone}}</text>
 						<text class="contact_more"> &gt;</text>
-						<text class="contact_shop">{{checkedAddr.contact_shop}}</text>
+						<view class="contact_shop text-ellipsis"  style="width: 250rpx; text-align: end"> 
+							<text v-if="checkedAddr.shop_type">&nbsp;({{ $CONSTANTS.SHOP_TYPES[checkedAddr.shop_type] }})</text>
+							{{checkedAddr.contact_shop}}
+						</view>
 					</view>
 					<view class="contact_addr" style="display: flex;">
 						{{checkedAddr.contact_province}} {{checkedAddr.contact_city}} {{checkedAddr.contact_area}}
 						{{checkedAddr.contact_addr}}
-						<view v-if="checkedAddr.shop_type">&nbsp;({{ $CONSTANTS.SHOP_TYPES[checkedAddr.shop_type] }})</view>
 					</view>
 				</view>
 				<view class="car_item">
@@ -241,11 +243,13 @@
 						<text class="contact_name">{{item.contact_name}}</text>
 						<text class="contact_phone">{{item.contact_phone}}</text>
 						<text class="contact_default" v-if="item.is_default">默认</text>
-						<text class="contact_shop">{{item.contact_shop}}</text>
+						<view class="contact_shop text-ellipsis"  style="width: 250rpx; text-align: end">
+							<text v-if="item.shop_type">({{ $CONSTANTS.SHOP_TYPES[item.shop_type] }})&nbsp;</text>
+							{{item.contact_shop}}
+						</view>
 					</view>
 					<view class="contact_addr" style="display:flex">
 						{{item.contact_province}} {{item.contact_city}} {{item.contact_area}} {{item.contact_addr}}
-						<view v-if="item.shop_type">&nbsp;({{ $CONSTANTS.SHOP_TYPES[item.shop_type] }})</view>
 					</view>
 				</view>
 			</view>

+ 17 - 2
pages/score/product.vue

@@ -29,10 +29,13 @@
 						<text class="contact_name" >{{checkedAddr.contact_name}}</text>
 						<text class="contact_phone" >{{checkedAddr.contact_phone}}</text>
 						<text class="contact_more"> &gt;</text>
+						<view class="contact_shop text-ellipsis" style="width: 250rpx; text-align: end">
+							<text v-if="checkedAddr.shop_type">({{ $CONSTANTS.SHOP_TYPES[checkedAddr.shop_type] }})&nbsp;</text>
+							{{ checkedAddr.contact_shop }}
+						</view>
 					</view>
 					<view class="contact_addr" style="display: flex;">
 						{{checkedAddr.contact_province}} {{checkedAddr.contact_city}} {{checkedAddr.contact_area}} {{checkedAddr.contact_addr}}
-						<view v-if="checkedAddr.shop_type">&nbsp;({{ $CONSTANTS.SHOP_TYPES[checkedAddr.shop_type] }})</view>
 					</view>
 				</view>
 				<view class="car_item" >
@@ -78,10 +81,13 @@
 						<text class="contact_name">{{item.contact_name}}</text>
 						<text class="contact_phone">{{item.contact_phone}}</text>
 						<text class="contact_default" v-if="item.is_default">默认</text>
+						<view class="contact_shop text-ellipsis" style="width: 250rpx; text-align: end">
+							<text v-if="item.shop_type">({{ $CONSTANTS.SHOP_TYPES[item.shop_type] }})&nbsp;</text>
+							{{ item.contact_shop }}
+						</view>
 					</view>
 					<view class="contact_addr" style="display: flex;">
 						{{item.contact_province}} {{item.contact_city}} {{item.contact_area}} {{item.contact_addr}}
-						<view v-if="item.shop_type">&nbsp;({{ $CONSTANTS.SHOP_TYPES[item.shop_type] }})</view>
 					</view>
 				</view>
 			</view>
@@ -477,6 +483,11 @@
 						font-size: 40rpx;
 						font-weight: bold;
 					}
+					.contact_shop {
+						float: right;
+						font-size: 26rpx;
+						margin-right: 16rpx;
+					}
 				}
 				.contact_addr{
 					width: 620rpx;
@@ -812,6 +823,10 @@
 						margin-left: 16rpx;
 						border: 1rpx solid #F59A23;
 					}
+					.contact_shop {
+						float: right;
+						font-size: 26rpx;
+					}
 				}
 				.contact_addr{
 					float: left;