zzf 2 rokov pred
rodič
commit
6d3d4caad0
6 zmenil súbory, kde vykonal 84 pridanie a 41 odobranie
  1. 9 4
      src/api/common.js
  2. 7 3
      src/main.js
  3. 8 5
      src/util/request.js
  4. 14 11
      src/view/Home/Home.vue
  5. 45 17
      src/view/Home/home.css
  6. 1 1
      vite.config.js

+ 9 - 4
src/api/common.js

@@ -5,9 +5,9 @@ function getCategoryProduct(data,config) {
     return axiosInstance.post(url,data,config);
 }
 // 获取奖品
-function getRaffle() {
+function getRaffle(data) {
     let url = '/api/raffle/getRaffle';
-    return axiosInstance.post(url);
+    return axiosInstance.post(url,data);
 }
 // 获取中奖纪录
 function getRaffleList(data) {
@@ -29,12 +29,17 @@ function shareAddRaffleCount(data) {
     let url = '/api/raffle/shareAdd';
     return axiosInstance.post(url,data);
 }
-
+// 获取货币符号
+// function getCurrency(){
+//     let url ='/app-api/index/getRaffleCurrencies'
+//     return axiosInstance.post(url);
+// }
 export {
     getCategoryProduct,
     getRaffle,
     getRaffleList,
     getPointsAndCount,
     raffleAction,
-    shareAddRaffleCount
+    shareAddRaffleCount,
+    // getCurrency
 };

+ 7 - 3
src/main.js

@@ -11,16 +11,20 @@ const app = Vue.createApp(App);
 
 
 var userToken = bridge.call('gettoken');
-// var userToken = "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJsYXQiOjE2ODYxMjA5NTMsIm5iZiI6MTY4NjEyMDk1MywiZXhwIjoxNjg2NTUyOTUzLCJ1aWQiOiIxNjE0MDEiLCJ3ZWJzaXRlIjoiYWxpcGVhcmxoYWlyIn0.saQc_A-aFj8zaZ8nyXPZhJogA9Kt5ghxqtzhEEgkwcY";
+// var userCookie =bridge.call('getCookie');
+// var userToken = "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJsYXQiOjE2OTE0ODMwMTEsIm5iZiI6MTY5MTQ4MzAxMSwiZXhwIjoxNjkxOTE1MDExLCJ1aWQiOiIxNjE0NDIiLCJ3ZWJzaXRlIjoiYWxpcGVhcmxoYWlyIn0.z4fgRskKFVspisnSKa-1b9fVDiX9kyrSnT38T5gFL_8";
 // var userToken = "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJsYXQiOjE2ODYxMjk3ODEsIm5iZiI6MTY4NjEyOTc4MSwiZXhwIjoxNjg2NTYxNzgxLCJ1aWQiOiIxNjEzMjciLCJ3ZWJzaXRlIjoiYWxpcGVhcmxoYWlyIn0.nlquLgwNulrTUeECyr4CQROtOJijy99AwWehrh7IJHc";
-
+// var userCookie =  "frontend=tcr49m50c7j34ei4vdvtgf5vs4;";
 
 console.log('入口文件获取userToken ----- ', userToken);
 // app.provide('userToken', userToken);
 if(userToken) {
     window.sessionStorage.setItem('usertoken', userToken);
 }
-
+// if(userCookie){
+//     window.sessionStorage.setItem('userCookie', userCookie);
+//     document.cookie =userCookie;
+// }
 //确保 _use_ 路由实例使
 //整个应用支持路由。
 app.use(router);

+ 8 - 5
src/util/request.js

@@ -42,11 +42,10 @@ axiosInstance.interceptors.request.use(function (config) {
     if(env === 'production') {
         let apiTypeReg = /(\/app\-api\/)|(\/api\/)/ig;
         let urlMap = {
-            '/api/':'https://actapi.snjon.com',  
-            // 'https://actapi.longyihair.com',
-            '/app-api/': 'https://alipearlapp.snjon.com'//,
-            // 'https://ios.alipearlhair.com',   //正式站
-            // '/api/': 'https://actapi.snjon.com',
+            // '/api/':'https://actapi.snjon.com',  
+            '/api/':'https://actapi.longyihair.com',
+            // '/app-api/': 'https://alipearlapp.snjon.com'//,
+            '/app-api/': 'https://ios.alipearlhair.com',   //正式站
         };
         let urlType = config.url.match(apiTypeReg)[0];
         if(urlType) {
@@ -63,9 +62,13 @@ axiosInstance.interceptors.request.use(function (config) {
     } 
     // 添加token
     var userToken = window.sessionStorage.getItem('usertoken');
+    // var userCookie = window.sessionStorage.getItem('userCookie');
     if(userToken) {
         config.headers['token'] = userToken;
     }
+    // if(userCookie) {
+    //     config.headers['Cookie'] = userCookie;
+    // }
     // console.log('request config --- ',config);
     return config;
 }, function (error) {

+ 14 - 11
src/view/Home/Home.vue

@@ -9,7 +9,6 @@ import { useRouter } from 'vue-router';
 import bridge from 'dsbridge';
 import * as axios from 'axios';
 // import eruda from "eruda";
-
 import { Toast,Popup,Dialog  } from 'vant';
 import * as $lib from '@/util/lib.js';
 import { RaffleRotate } from '@/util/rafflerotating.js';
@@ -64,7 +63,10 @@ const toastText = ref('');
 const toastType = ref('error');
 
 const wheelActive = ref(0);
-
+let  coincode2 =bridge.call('getCurrenciesCode ');
+// ZAR,USD,CAD,AUD,GBP,EUR
+// coincode2 = "EUR";
+// console.log('coincode2----',coincode2);
 // 单个 ref
 watch(showToast, (newX) => {
     if(newX) {
@@ -84,10 +86,10 @@ onMounted(function() {
 });
 
 function init() {
-    requestProductList().then((res) => {
+    requestProductList(coincode2).then((res) => {
         pickedProductList.value = res.data.product;
     });
-    getPrize().then((res) => {
+    getPrize({code:coincode2}).then((res) => {
         console.log('getPrize res-- ', res);
         prizeList.value = res.data.prize;
         activityId.value = res.data.id;
@@ -353,17 +355,18 @@ function setTitle(title) {
     return bridge.call('provide_title',title);
 }
 // 获取产品列表
-function requestProductList() {
+function requestProductList(data) {
     return getCategoryProduct({
         entity_id: 224,
         page: 1,
         size: 10,
-        order: 'position'
+        order: 'position',
+        code:data
     });
 }
 // 获取活动奖品
-function getPrize() {
-    return getRaffle();
+function getPrize(data) {
+    return getRaffle(data);
 }
 // 获取中奖纪录
 function getPrizeUserList(id) {
@@ -407,7 +410,7 @@ function shareRequest(id) {
                         :data-title="prize.title"
                     >   
                         <span v-if="prize.title === 'Thanks'" class="lucky-wheel-item-title">{{prize.title}}</span>
-                        <span v-else-if="prize.price" class="lucky-wheel-item-title">{{prize.price}}</span>
+                        <span v-else-if="prize.price" class="lucky-wheel-item-title" :data-country="prize.title=='Points' ? '':coincode2"  >{{prize.price}}</span>
                         <span v-if="prize.title && prize.title !== 'Thanks'" class="lucky-wheel-item-label">{{prize.title}}</span>
                         <span v-else-if="prize.title === 'Thanks'" class="lucky-wheel-item-title">&nbsp;</span>
                     </div>
@@ -546,11 +549,11 @@ function shareRequest(id) {
                 </div>
                 <div class="lucky-wheel-modal-coupon-right">
                     <div class="lucky-wheel-modal-cinfo">
-                        <div class="lucky-wheel-modal-cinfo-title">{{raffleResult.prize.price}} OFF</div>
+                        <div class="lucky-wheel-modal-cinfo-title" :data-country="coincode2" >{{raffleResult.prize.price}} OFF</div>
                         <div class="lucky-wheel-modal-cinfo-tips">* Valid 7 Days</div>
                     </div>
                     <div class="lucky-wheel-modal-ccode">
-                        <span>CODE: {{raffleResult.prize.code}}</span>
+                        <span>DISCOUNT</span>
                     </div>
                     <div class="dot top"></div>
                     <div class="dot bottom"></div>

+ 45 - 17
src/view/Home/home.css

@@ -85,13 +85,13 @@
     /* transition-property: transform;
     transition-duration: 6s; */
 }
-.lucky-wheel-box[active="4"] .lucky-wheel-item.index-2{
+/* .lucky-wheel-box[active="4"] .lucky-wheel-item.index-2{
     right: 1.1733rem
-}
-.lucky-wheel-box[active="4"] .lucky-wheel-item.index-5{
+} */
+/* .lucky-wheel-box[active="4"] .lucky-wheel-item.index-5{
     left: .9867rem;
-}
-.lucky-wheel-box[active="5"] .lucky-wheel-item.index-1{
+} */
+/* .lucky-wheel-box[active="5"] .lucky-wheel-item.index-1{
     left: 3.0133rem;
 }
 .lucky-wheel-box[active="5"] .lucky-wheel-item.index-2{
@@ -99,20 +99,23 @@
 }
 .lucky-wheel-box[active="1"] .lucky-wheel-item.index-2{
   top: 1.8667rem;
-}
-.lucky-wheel-box[active="1"] .lucky-wheel-item.index-5{
+} */
+/* .lucky-wheel-box[active="1"] .lucky-wheel-item.index-5{
     top: 4.64rem;
-}
-.lucky-wheel-box[active="2"] .lucky-wheel-item.index-1{
+} */
+/* .lucky-wheel-box[active="2"] .lucky-wheel-item.index-1{
     left: 3.0933rem;
     top: .5333rem;
-}
-.lucky-wheel-box[active="2"] .lucky-wheel-item.index-2{
+} */
+/* .lucky-wheel-box[active="2"] .lucky-wheel-item.index-2{
+    right: 1.2267rem;
+} */
+.lucky-wheel-box[active="2"] .lucky-wheel-item.index-3{
     right: 1.2267rem;
 }
-.lucky-wheel-box[active="3"] .lucky-wheel-item.index-1{
+/* .lucky-wheel-box[active="3"] .lucky-wheel-item.index-1{
     left: 3.2267rem;
-}
+} */
 .lucky-wheel-box[active="3"] .lucky-wheel-item.index-4{
     left: 3.3867rem;
 }
@@ -131,6 +134,22 @@
     font-size: .64rem;
     font-weight: bold;
 }
+.lucky-wheel-item-title[data-country="ZAR"] {
+    font-size: .4rem;
+    font-weight: bold;
+}
+.lucky-wheel-item-title[data-country="CAD"] {
+    font-size: .44rem;
+    font-weight: bold;
+}
+.lucky-wheel-item-title[data-country="AUD"] {
+    font-size: .55rem;
+    font-weight: bold;
+}
+/* .lucky-wheel-item-title[data-country="EUR"] {
+    font-size: .55rem;
+    font-weight: bold;
+} */
 .lucky-wheel-item-label{
     font-size: .32rem;
     font-weight: 400;
@@ -160,11 +179,13 @@
 }
 .lucky-wheel-item[data-index="1"]{
     top: .6667rem;
-    left: 3.3067rem;
+    left: 2.9rem;
+    width: 2rem;
 }
 .lucky-wheel-item[data-index="2"]{
     top: 1.92rem;
-    right: .9867rem;
+    right: .6rem;
+    width: 2rem;
 }
 .lucky-wheel-item[data-index="3"]{
     /* bottom: 1.8933rem; */
@@ -181,8 +202,9 @@
     top: 4.4267rem;
 }
 .lucky-wheel-item[data-index="6"]{
-    left: 1.0933rem;
+    left: 0.8rem;
     top: 1.92rem;
+    width: 2rem;
 }
 /*
 .lucky-wheel-item[data-index="1"]{
@@ -523,6 +545,12 @@ background: linear-gradient(336deg, #FEDFA9 0%, #E0B17E 100%);
     font-weight: bold;
     text-align: center;
 }
+.lucky-wheel-modal-cinfo-title[data-country="CAD"] {
+    font-size: .65rem;
+}
+.lucky-wheel-modal-cinfo-title[data-country="ZAR"] {
+    font-size: .65rem;
+}
 .lucky-wheel-modal-cinfo-tips{
     font-size: .32rem;
     color: #0b0b0b;
@@ -541,7 +569,7 @@ background: linear-gradient(336deg, #FEDFA9 0%, #E0B17E 100%);
 .lucky-wheel-modal-ccode span{
     display: block;
     font-size: .32rem;
-    font-weight: bold;
+    font-weight: 500;
     transform: rotate(270deg);
     white-space: nowrap;
 }

+ 1 - 1
vite.config.js

@@ -66,7 +66,7 @@ export default defineConfig({
         //   '/api': 'http://www.myblog.com/api',
           // 选项写法
           '/app-api': {
-            target: 'htttps:alipearlapp.snjon.com',
+            target: 'https:alipearlapp.snjon.com',
             // "https://ios.alipearlhair.com",//正式站    'http://www.myblog.com',
             changeOrigin: true, // 设置成false报错
             // rewrite: (path) => {