Преглед на файлове

商品价格转换为sL

zhangle преди 5 месеца
родител
ревизия
73667e5326

+ 4 - 3
crmeb_src/mer_java/crmeb-common/src/main/java/com/zbkj/common/response/FrontGlobalConfigResponse.java

@@ -10,6 +10,7 @@ import lombok.experimental.Accessors;
 
 import javax.validation.constraints.NotBlank;
 import java.io.Serializable;
+import java.math.BigDecimal;
 
 /**
  * 移动端全局配置信息响应对象
@@ -63,12 +64,12 @@ public class FrontGlobalConfigResponse implements Serializable {
     private String authorizeFilingNum;
 
     @ApiModelProperty(value = "代币汇率-LGNS-USDT")
-    private String daibiRateLgnsUsd;
+    private BigDecimal daibiRateLgnsUsd;
 
     @ApiModelProperty(value = "代币汇率-LGNS-CNY")
-    private String daibiRateLgnsCny;
+    private BigDecimal daibiRateLgnsCny;
 
     @ApiModelProperty(value = "代币汇率-USDT-CNY")
-    private String daibiRateUsdCny;
+    private BigDecimal daibiRateUsdCny;
 
 }

+ 9 - 0
crmeb_src/mer_java/crmeb-front/src/main/java/com/zbkj/front/service/impl/IndexServiceImpl.java

@@ -14,6 +14,7 @@ import com.zbkj.common.page.CommonPage;
 import com.zbkj.common.request.PageParamRequest;
 import com.zbkj.common.response.*;
 import com.zbkj.common.utils.CrmebUtil;
+import com.zbkj.common.utils.RedisUtil;
 import com.zbkj.common.vo.MyRecord;
 import com.zbkj.common.vo.SplashAdConfigVo;
 import com.zbkj.common.vo.SplashAdDataVo;
@@ -68,6 +69,8 @@ public class IndexServiceImpl implements IndexService {
     private UserMerchantCollectService userMerchantCollectService;
     @Autowired
     private GroupConfigService groupConfigService;
+    @Autowired
+    private RedisUtil redisUtil;
 
     /**
      * 首页数据
@@ -327,6 +330,12 @@ public class IndexServiceImpl implements IndexService {
         response.setAuthorizeAddress(myRecord.getStr(SysConfigConstants.SHOPPING_AUTHORIZE_ADDRESS));
         response.setAuthorizeInfo(myRecord.getStr(SysConfigConstants.SHOPPING_AUTHORIZE_INFO));
         response.setAuthorizeFilingNum(myRecord.getStr(SysConfigConstants.SHOPPING_AUTHORIZE_FILING_NUM));
+
+        // 获取汇率
+        response.setDaibiRateLgnsUsd(redisUtil.get(SysConfigConstants.DAIBI_RATE_LGNS_USD));
+        response.setDaibiRateLgnsCny(redisUtil.get(SysConfigConstants.DAIBI_RATE_LGNS_CNY));
+        response.setDaibiRateUsdCny(redisUtil.get(SysConfigConstants.DAIBI_RATE_USD_CNY));
+
         return response;
     }
 

+ 9 - 4
crmeb_src/mer_uniapp/components/svipPrice.vue

@@ -1,9 +1,9 @@
 <template>
 	<view class="acea-row items-baseline">
 		<view :class="priceColor.color?'':'x-money'" class="mr-12 acea-row items-baseline relative" :style="svipPriceStyle.topStyle?[svipPriceStyle.topStyle,priceColor]:[priceColor]">
-			<view class="f-s-26"></view>
+			<view class="f-s-26">sL</view>
 			<view v-if="productPrice.groupPrice" class='tui-skeleton-rect semiBold' :style="[svipIconStyle.price]">{{productPrice.groupPrice}}</view>
-			<view v-else class='tui-skeleton-rect semiBold' :style="[svipIconStyle.price]">{{userIsPaidMember && productPrice.isPaidMember?productPrice.vipPrice:productPrice.price}}</view>
+			<view v-else class='tui-skeleton-rect semiBold' :style="[svipIconStyle.price]">{{rmbToLgnsHandle(userIsPaidMember && productPrice.isPaidMember?productPrice.vipPrice:productPrice.price)}}</view>
 		</view>
 		<view v-if="userIsPaidMember && productPrice.isPaidMember" class="svip-icon acea-row row-middle" :style="[svipIconStyle.svipBox]">
 			<view :style="[svipIconStyle.svipPrice]">SVIP会员价</view>
@@ -17,10 +17,10 @@
 </template>
 
 <script>
-	import {configMap} from "../utils";
+	import {configMap, rmbToLgns} from "../utils";
 
   export default {
-    computed: configMap(['userIsPaidMember','paidMemberPriceDisplay']),
+		computed: configMap(['userIsPaidMember','paidMemberPriceDisplay']),
 		props: {
 			//是否展示返回按钮
 			productPrice: {
@@ -44,6 +44,11 @@
 					return {}
 				}
 			}
+		},
+		methods: {
+			rmbToLgnsHandle(rmb){
+				return rmbToLgns(rmb)
+			}
 		}
 	}
 </script>

+ 6 - 2
crmeb_src/mer_uniapp/pages/goods/goods_details/index.vue

@@ -317,7 +317,7 @@
 												height="204rpx"></easy-loadimage>
 										</view>
 										<view class="name line2 mt-20 h-74 lh-38rpx">{{ val.name }}</view>
-										<view class="money theme_price regular">¥{{ val.price }}</view>
+										<view class="money theme_price regular">sL{{ rmbToLgnsHandle(val.price) }}</view>
 									</view>
 								</view>
 							</view>
@@ -668,7 +668,8 @@
 	import merHome from "@/components/merHome/index.vue";
 	import mpHtml from "@/uni_modules/mp-html/components/mp-html/mp-html.vue";
 	import {
-		silenceBindingSpread
+		silenceBindingSpread,
+		rmbToLgns
 	} from "@/utils";
 	import parser from "../components/jyf-parser/jyf-parser";
 	import tuiDrawer from "@/components/tui-drawer/tui-drawer.vue";
@@ -1082,6 +1083,9 @@
 		},
 		// #endif
 		methods: {
+			rmbToLgnsHandle(rmb){
+				return rmbToLgns(rmb)
+			},
 			// 保障协议弹出框
 			handleToGgle(type) {
 				if (type) {

+ 2 - 2
crmeb_src/mer_uniapp/pages/index/index.vue

@@ -29,13 +29,13 @@
 		</view>
 		<!-- 备案号、授权信息 -->
 		<!-- #ifdef H5 -->
-		<view v-show="(globalData.authorizeFilingNum || globalData.authorizeInfo) && !isShowGuide"
+<!-- 		<view v-show="(globalData.authorizeFilingNum || globalData.authorizeInfo) && !isShowGuide"
 			class="mt-40 mb-40rpx">
 			<view @click="toInternet" class="text-center text-24rpx text--w111-666 mb-24 3cfea756">
 				{{globalData.authorizeFilingNum}}
 			</view>
 			<view class="text-center text-24rpx text--w111-666 48bfb4a">{{globalData.authorizeInfo}}</view>
-		</view>
+		</view> -->
 		<!-- #endif -->
 
 		<!-- 底部导航距离,做兼容处理的-->

+ 3 - 0
crmeb_src/mer_uniapp/store/modules/app.js

@@ -256,6 +256,9 @@ const mutations = {
 		state.globalData.authorizeInfo = data.authorizeInfo;
 		state.globalData.authorizePhone = data.authorizePhone;
 		state.globalData.merchantApplySwitch = data.merchantApplySwitch;
+		state.globalData.daibiRateLgnsUsd = data.daibiRateLgnsUsd;
+		state.globalData.daibiRateLgnsCny = data.daibiRateLgnsCny;
+		state.globalData.daibiRateUsdCny = data.daibiRateUsdCny;
 		Cache.set(GLOBAL_DATA, state.globalData);
 	},
 	// 分销码

+ 6 - 0
crmeb_src/mer_uniapp/utils/index.js

@@ -108,4 +108,10 @@ export function getCityList() {
 	});
 }
 
+export function rmbToLgns(rmb){
+	let rate = Store.getters.globalData.daibiRateLgnsCny
+	if(!rate) rate = 1
+	return (rmb / rate).toFixed(2)
+}
+
 export default parseQuery;