panhui 6 years ago
parent
commit
cc5863de62

+ 4 - 0
pom.xml

@@ -265,6 +265,10 @@
             <groupId>org.springframework</groupId>
             <artifactId>spring-context-support</artifactId>
         </dependency>
+        <dependency>
+            <groupId>org.assertj</groupId>
+            <artifactId>assertj-core</artifactId>
+        </dependency>
 
     </dependencies>
 

+ 2 - 0
src/main/java/com/izouma/immall/dto/CartVO.java

@@ -32,6 +32,8 @@ public class CartVO implements Serializable {
     private String goodsIconUrl;
     @ApiModelProperty(value = "商品价格")
     private BigDecimal price;
+    @ApiModelProperty(value = "商品价格")
+    private BigDecimal vipPrice;
     @ApiModelProperty(value = "商品件数")
     private Integer piece;
     @ApiModelProperty(value = "是否可用")

+ 2 - 0
src/main/java/com/izouma/immall/repo/GoodsRepo.java

@@ -13,6 +13,8 @@ public interface GoodsRepo extends JpaRepository<Goods, Long>, JpaSpecificationE
 
     List<Goods> findAllByNameLike(String name);
 
+    Goods findFirstByType(String type);
+
     Goods findFirstById(Long goodsId);
     @Query(nativeQuery = true,value = "SELECT * FROM Goods g  WHERE  g.disabled = 0  and g.type = 'NORMAL'  order by g.sales_volume DESC limit 6")
     List<Goods> findMostSalesGoods();

+ 28 - 6
src/main/java/com/izouma/immall/service/CartService.java

@@ -15,7 +15,9 @@ import org.springframework.data.jpa.domain.Specification;
 import org.springframework.stereotype.Service;
 
 import java.util.ArrayList;
+import java.util.Arrays;
 import java.util.List;
+import java.util.Optional;
 
 @Service
 public class CartService {
@@ -26,20 +28,21 @@ public class CartService {
     @Autowired
     private GoodsRepo goodsRepo;
 
-    public List<CartVO> showMyCarts(Long userId){
+    public List<CartVO> showMyCarts(Long userId) {
         List<Cart> carts = cartRepo.findAll((Specification<Cart>) (root, criteriaQuery, criteriaBuilder) ->
                 criteriaQuery.where(
                         root.get("userId").in(userId)
                 ).getRestriction());
-         List<CartVO> cartVOS = new ArrayList<>();
+        List<CartVO> cartVOS = new ArrayList<>();
         carts.forEach(cart -> {
-            CartVO cartVO=new CartVO();
-            Goods goods=goodsRepo.findFirstById(cart.getGoodsId());
+            CartVO cartVO = new CartVO();
+            Goods goods = goodsRepo.findFirstById(cart.getGoodsId());
             cartVO.setCartId(cart.getId());
             cartVO.setGoodsId(goods.getId());
             cartVO.setGoodsIconUrl(goods.getIcon());
             cartVO.setGoodsName(goods.getName());
             cartVO.setPrice(goods.getPrice());
+            cartVO.setVipPrice(goods.getVipPrice());
             cartVO.setPiece(cart.getPiece());
             cartVO.setDisabled(cart.getDisabled());
             cartVOS.add(cartVO);
@@ -47,8 +50,27 @@ public class CartService {
         return cartVOS;
     }
 
-    public CartVO showThisCart(Long cartId){
-        Cart cart =cartRepo.findById(cartId).get();
+    public List<CartVO> showCartsByIds(String ids) {
+        List<CartVO> cartVOS = new ArrayList<>();
+        Arrays.asList(ids.split(",")).forEach(id -> {
+            Cart cart = cartRepo.findById(Long.valueOf(id)).get();
+            CartVO cartVO = new CartVO();
+            Goods goods = goodsRepo.findFirstById(cart.getGoodsId());
+            cartVO.setCartId(cart.getId());
+            cartVO.setGoodsId(goods.getId());
+            cartVO.setGoodsIconUrl(goods.getIcon());
+            cartVO.setGoodsName(goods.getName());
+            cartVO.setPrice(goods.getPrice());
+            cartVO.setVipPrice(goods.getVipPrice());
+            cartVO.setPiece(cart.getPiece());
+            cartVO.setDisabled(cart.getDisabled());
+            cartVOS.add(cartVO);
+        });
+        return cartVOS;
+    }
+
+    public CartVO showThisCart(Long cartId) {
+        Cart cart = cartRepo.findById(cartId).get();
         Goods goods = goodsRepo.findById(cart.getGoodsId()).get();
         return CartVO.builder()
                 .piece(cart.getPiece())

+ 2 - 1
src/main/java/com/izouma/immall/service/VipIdentityService.java

@@ -153,7 +153,8 @@ public class VipIdentityService {
       //  User user = userRepo.findById(userId).orElseThrow(new BusinessException("用户不存在"));
         VipUser user = vipUserRepo.findByUserId(userId);
         if(user==null){
-            throw new BusinessException("不是VIP");
+//            throw new BusinessException("不是VIP");
+            return;
         }
 
         //身份排序从小到大

+ 5 - 0
src/main/java/com/izouma/immall/web/CartController.java

@@ -45,6 +45,11 @@ public class CartController extends BaseController {
         return cartService.showMyCarts(userId);
     }
 
+    @GetMapping("/showCartsByIds")
+    public List<CartVO> showCartsByIds( String ids) {
+        return cartService.showCartsByIds(ids);
+    }
+
     @GetMapping("/get/{id}")
     public CartVO get(@PathVariable Long id) {
         return cartService.showThisCart(id);

+ 21 - 14
src/main/java/com/izouma/immall/web/GoodsController.java

@@ -1,4 +1,5 @@
 package com.izouma.immall.web;
+
 import com.izouma.immall.domain.Goods;
 import com.izouma.immall.dto.SetGoodsVO;
 import com.izouma.immall.dto.SetVO;
@@ -6,6 +7,7 @@ import com.izouma.immall.service.GoodsService;
 import com.izouma.immall.dto.PageQuery;
 import com.izouma.immall.exception.BusinessException;
 import com.izouma.immall.repo.GoodsRepo;
+import com.izouma.immall.utils.JsonUtils;
 import com.izouma.immall.utils.ObjUtils;
 import com.izouma.immall.utils.excel.ExcelUtils;
 import io.swagger.annotations.ApiModel;
@@ -53,29 +55,34 @@ public class GoodsController extends BaseController {
     }
 
     @GetMapping("/showThisGood")
-    public Map<String,Object> showThisGood(Long goodsId,Long userId){
-        return goodsService.showThisGood(goodsId,userId);
+    public Map<String, Object> showThisGood(Long goodsId, Long userId) {
+        return goodsService.showThisGood(goodsId, userId);
     }
 
     @GetMapping("/goodsPage/{userId}")
-    public Map<String,Object> showGoodsPage(@PathVariable Long userId){
-        Map<String,Object> Goods = new HashMap<>();
-        Goods.put("set",goodsService.findAllByType(userId));
-        Goods.put("mostSales",goodsService.findMostSalesGoods());
-        Goods.put("newest",goodsService.findNewestGoods());
+    public Map<String, Object> showGoodsPage(@PathVariable Long userId) {
+        Map<String, Object> Goods = new HashMap<>();
+        Goods.put("set", goodsService.findAllByType(userId));
+        Goods.put("mostSales", goodsService.findMostSalesGoods());
+        Goods.put("newest", goodsService.findNewestGoods());
         return Goods;
     }
 
     @GetMapping("/findSetGoods")
-    public Page<Goods> findSetGoods(String type,Pageable pageable){
-        return goodsService.findSetGoods(type,pageable);
+    public Page<Goods> findSetGoods(String type, Pageable pageable) {
+        return goodsService.findSetGoods(type, pageable);
+    }
+
+    @GetMapping("/getOne")
+    public Goods getOne(Long goodsId) {
+        return goodsRepo.findFirstByType("NORMAL");
     }
 
 
-//    @PreAuthorize("hasRole('ADMIN')")
+    //    @PreAuthorize("hasRole('ADMIN')")
     @GetMapping("/all")
-    public Page<Goods> all(String searchKey,Pageable pageable) {
-        return goodsService.findAll(searchKey,pageable);
+    public Page<Goods> all(String searchKey, Pageable pageable) {
+        return goodsService.findAll(searchKey, pageable);
     }
 
     @GetMapping("/allSet/{userId}")
@@ -95,8 +102,8 @@ public class GoodsController extends BaseController {
 
     @GetMapping("/excel")
     @ResponseBody
-    public void excel(HttpServletResponse response,String searchKey, Pageable pageable) throws IOException {
-        List<Goods> data = all(searchKey,pageable).getContent();
+    public void excel(HttpServletResponse response, String searchKey, Pageable pageable) throws IOException {
+        List<Goods> data = all(searchKey, pageable).getContent();
         ExcelUtils.export(response, data);
     }
     /*generatedEnd*/

BIN
src/main/maskMall/src/assets/haibao.png


+ 12 - 2
src/main/maskMall/src/components/ShoppingCar.vue

@@ -16,7 +16,7 @@
             <div class="text2 ">
                 <!-- {{info.goodsName}} -->
             </div>
-            <div class="price">{{ info.price }}</div>
+            <div class="price">{{ isVip ? info.vipPrice : info.price }}</div>
 
             <div style="flex-grow:1"></div>
 
@@ -48,7 +48,14 @@ export default {
         };
     },
     computed: {
-        ...mapState(["userInfo"])
+        ...mapState(["userInfo"]),
+        isVip() {
+            if (this.userInfo.vipInfo) {
+                return true;
+            } else {
+                return false;
+            }
+        }
     },
     watch: {
         info() {
@@ -91,6 +98,8 @@ export default {
 .goods-info {
     display: flex;
     padding: 15px 0;
+    overflow: hidden;
+    width: 100%;
 }
 .content {
     flex-grow: 1;
@@ -98,6 +107,7 @@ export default {
     padding: 0 0px 0 10px;
     display: flex;
     flex-direction: column;
+    overflow: hidden;
 
     .text1 {
         font-size: 14px;

+ 202 - 0
src/main/maskMall/src/components/VipCenter.vue

@@ -0,0 +1,202 @@
+<template>
+    <div class="vip">
+        <div class="vip-time">
+            <van-image :src="require('../assets/vip_img_01.png')"></van-image>
+
+            <div class="time">
+                <span>会员到期时间</span>
+                <span>{{ time }}</span>
+            </div>
+        </div>
+
+        <div class="top">
+            <div class="text1">
+                <span>{{ money }}</span>
+                <span>元</span>
+            </div>
+            <div class="text2">我的佣金</div>
+            <div class="btn-list">
+                <van-button
+                    type="primary"
+                    size="small"
+                    @click="goNext('withdrawal')"
+                    >提现</van-button
+                >
+                <van-button
+                    color="#E5E2E3"
+                    size="small"
+                    @click="goNext('moneyList')"
+                    ><span style="color:#1A1A1A">明细</span></van-button
+                >
+            </div>
+        </div>
+        <div class="menu-list">
+            <van-cell-group :border="false">
+                <van-cell
+                    title="我的团队"
+                    title-class="menu-title"
+                    value-class="menu-val"
+                    @click="goNext('team')"
+                    :value="vipInfo.fansNum + '位'"
+                    is-link
+                >
+                    <img
+                        src="../assets/fenxiao_icon_fensi.png"
+                        class="menu-img"
+                        slot="icon"
+                        alt
+                    />
+                </van-cell>
+                <van-cell
+                    title="推广海报"
+                    title-class="menu-title"
+                    @click="goNext('extension')"
+                >
+                    <img
+                        src="../assets/fenxiao_icon_tuiguang.png"
+                        class="menu-img"
+                        slot="icon"
+                        alt
+                    />
+                </van-cell>
+            </van-cell-group>
+        </div>
+    </div>
+</template>
+<script>
+import { mapState } from "vuex";
+import { parse, addYears, format } from "date-fns";
+export default {
+    name: "vip",
+    data() {
+        return {
+            vipUser: {},
+            activeName: 0,
+            vipList: []
+        };
+    },
+    computed: {
+        ...mapState(["userInfo"]),
+        vipInfo() {
+            return this.userInfo.vipInfo || {};
+        },
+        time() {
+            var time = this.vipInfo.startTime || "";
+            if (time) {
+                return format(
+                    addYears(parse(time, "yyyy-MM-dd HH:mm:ss", new Date()), 1),
+                    "yyyy-MM-dd"
+                );
+            } else {
+                return "";
+            }
+        },
+        money() {
+            var money = this.vipInfo.money || 0;
+            return money.toFixed(2);
+        }
+    }
+};
+</script>
+<style lang='less' scoped>
+@import "../MyMixin.less";
+.vip {
+    padding: 15px;
+}
+
+.vip-time {
+    position: relative;
+    .time {
+        position: absolute;
+        top: .mix-getVal(74px) [];
+        left: .mix-getVal(28px) [];
+        font-size: 14px;
+        font-weight: lighter;
+        color: rgba(124, 70, 51, 1);
+        line-height: 20px;
+        span {
+            margin-right: 10px;
+        }
+    }
+}
+.top {
+    height: 150px;
+    background: rgba(255, 255, 255, 1);
+    box-shadow: 0px 2px 8px 0px rgba(0, 0, 0, 0.06);
+    border-radius: 8px;
+    padding: 30px;
+    box-sizing: border-box;
+    margin-top: 20px;
+
+    .text1 {
+        span {
+            vertical-align: -webkit-baseline-middle;
+            &:first-child {
+                font-size: 24px;
+                font-weight: bold;
+                color: rgba(26, 26, 26, 1);
+                line-height: 28px;
+            }
+            &:last-child {
+                font-size: 12px;
+                font-weight: bold;
+                color: rgba(26, 26, 26, 1);
+                line-height: 20px;
+                margin-left: 4px;
+            }
+        }
+    }
+
+    .text2 {
+        font-size: 12px;
+        color: rgba(26, 26, 26, 1);
+        line-height: 17px;
+    }
+
+    .btn-list {
+        margin-top: 16px;
+    }
+}
+
+.van-button--small {
+    width: 88px;
+    height: 32px;
+    line-height: 32px;
+    border-radius: 4px;
+    margin-right: 10px;
+}
+
+.panel {
+    margin-top: 20px;
+}
+
+.menu-list {
+    margin: 20px 0 0;
+    background-color: #f7f9fa;
+    .van-cell {
+        line-height: 40px;
+        padding: 22px 15px 18px;
+    }
+    .menu-img {
+        width: 40px;
+        height: 40px;
+        margin-right: 12px;
+    }
+
+    .menu-title {
+        font-size: 14px;
+        color: rgba(0, 0, 0, 1);
+    }
+
+    .menu-not-val {
+        font-size: 13px;
+        color: rgba(255, 143, 0, 1);
+    }
+
+    .menu-val {
+        font-size: 13px;
+        color: rgba(170, 171, 173, 1);
+        margin-right: 10px;
+    }
+}
+</style>

+ 123 - 0
src/main/maskMall/src/components/VipCenterNo.vue

@@ -0,0 +1,123 @@
+<template>
+    <div class="vipno">
+        <div class="top">
+            <img class="logo" src="../assets/logo.png" alt="" />
+        </div>
+        <div class="ad">
+            原价购买任意单品即送一年IM会员<br />
+            后续持续享受会员专享价
+        </div>
+
+        <div class="menu-list">
+            <div class="menu-item">
+                <span>拥有超低的商品购买价格</span>
+            </div>
+            <div class="menu-item">
+                <span>推广用户,赚取高额佣金</span>
+            </div>
+        </div>
+
+        <div class="tips">你还不是IM会员,赶紧加入吧!</div>
+        <div class="btn-content">
+            <van-button type="primary" size="large" round @click="goGoods"
+                >立即成为IM会员</van-button
+            >
+        </div>
+    </div>
+</template>
+<script>
+export default {
+    name: "vipno",
+    methods: {
+        goGoods() {
+            this.$http.get("/goods/getOne").then(res => {
+                this.goNext("detail", { id: res.id });
+            });
+        }
+    }
+};
+</script>
+<style lang='less' scoped>
+@import "../MyMixin.less";
+.vipno {
+    position: relative;
+}
+.top {
+    height: 190px;
+    background: linear-gradient(
+        90deg,
+        rgba(255, 223, 188, 1) 0%,
+        rgba(255, 216, 164, 1) 100%
+    );
+    display: flex;
+
+    .logo {
+        width: 63px;
+        height: 58px;
+        margin: auto;
+    }
+}
+
+.ad {
+    width: 100%;
+    height: 132px;
+    background: rgba(255, 255, 255, 1);
+    border-radius: 40px;
+    position: absolute;
+    left: 0;
+    top: 142px;
+    font-size: 16px;
+    font-weight: lighter;
+    color: rgba(184, 28, 34, 1);
+    line-height: 30px;
+    display: flex;
+    align-items: center;
+    justify-content: center;
+    text-align: center;
+}
+
+.menu-list {
+    padding: 80px 15px 20px;
+
+    .menu-item {
+        height: 80px;
+        background: rgba(255, 255, 255, 1);
+        box-shadow: 0px 4px 8px 0px rgba(0, 0, 0, 0.1);
+        border-radius: 8px;
+        padding: 0 20px;
+        display: flex;
+        align-items: center;
+        margin-bottom: 20px;
+
+        img {
+            width: 42px;
+            height: 42px;
+            margin-right: 14px;
+        }
+
+        span {
+            font-size: 18px;
+            font-weight: bold;
+            color: rgba(0, 0, 0, 1);
+            line-height: 25px;
+        }
+    }
+}
+
+.tips {
+    font-size: 13px;
+    color: rgba(147, 149, 153, 1);
+    line-height: 18px;
+    text-align: center;
+    padding: 16px;
+}
+.btn-content {
+    width: 290px;
+    margin: 0 auto 30px;
+
+    .van-button {
+        height: 44px;
+        line-height: 44px;
+    }
+}
+</style>

+ 11 - 0
src/main/maskMall/src/main.less

@@ -466,6 +466,10 @@ body {
 .shopping {
     .van-checkbox__label {
         flex-grow: 1;
+        overflow: hidden;
+    }
+    .van-checkbox__icon {
+        min-width: 16px;
     }
 }
 
@@ -588,3 +592,10 @@ body {
         }
     }
 }
+
+.vip {
+    .van-cell__left-icon,
+    .van-cell__right-icon {
+        line-height: 40px;
+    }
+}

+ 2 - 9
src/main/maskMall/src/plugins/http.js

@@ -17,6 +17,7 @@ switch (process.env.NODE_ENV) {
         break;
 }
 const axiosInstance = axios.create({ baseURL: baseUrl });
+const showError = true;
 axiosInstance.interceptors.request.use(
     function(config) {
         config.headers = config.headers || {};
@@ -36,7 +37,7 @@ axiosInstance.interceptors.response.use(
         return response;
     },
     function(error) {
-        console.log(error.response.status);
+        console.log(error.response);
         error.response.data.status = error.response.status;
         if (error.response.status != "401") {
             Toast(error.response.data.error);
@@ -49,12 +50,6 @@ const http = {
     get(url, params) {
         params = params || {};
         return new Promise((resolve, reject) => {
-            // Toast.loading({
-            //     mask: true,
-            //     message: "加载中...",
-            //     loadingType: 'spinner',
-            //     duration: 0
-            // });
             axiosInstance
                 .get(
                     url,
@@ -74,7 +69,6 @@ const http = {
         });
     },
     post(url, body, options) {
-        console.log(url);
         options = options || {};
         body = body || {};
         if (!(body instanceof FormData)) {
@@ -82,7 +76,6 @@ const http = {
                 body = qs.stringify(body);
             }
         }
-        console.log(body);
         return new Promise((resolve, reject) => {
             axiosInstance
                 .post(url, body, { withCredentials: true })

+ 57 - 30
src/main/maskMall/src/router/index.js

@@ -277,6 +277,47 @@ router.beforeEach((to, from, next) => {
             loadingType: "spinner",
             duration: 0
         });
+        checkPage(to)
+            .then(_ => {
+                //判断是否分享
+                if (sessionStorage["shareUrl"] && !sessionStorage["goShare"]) {
+                    var shareUrl = sessionStorage["shareUrl"];
+                    sessionStorage["goShare"] = true;
+                    next({
+                        name: shareUrl.split("_")[0],
+                        query: {
+                            id: shareUrl.split("_")[1],
+                            type: "isShare"
+                        },
+                        replace: true
+                    });
+                } else {
+                    next();
+                }
+            })
+            .catch(e => {
+                if (
+                    typeof e == "object" &&
+                    e.path == router.currentRoute.path
+                ) {
+                    next(false);
+                } else {
+                    next(e);
+                }
+            });
+    }
+});
+router.afterEach((to, from) => {
+    Toast.clear();
+});
+
+router.onError(error => {
+    console.log(error);
+    Toast.clear();
+});
+
+function checkPage(to) {
+    return new Promise((resolve, reject) => {
         if (
             (!store.state.userInfo.id && to.meta.type != "login") ||
             to.meta.type === "user" ||
@@ -285,58 +326,44 @@ router.beforeEach((to, from, next) => {
             //获取用户信息
             getUserInfo()
                 .then(_ => {
-                    console.log(sessionStorage["shareUrl"]);
-                    if (
-                        sessionStorage["shareUrl"] &&
-                        !sessionStorage["goShare"]
-                    ) {
-                        var shareUrl = sessionStorage["shareUrl"];
-                        sessionStorage["goShare"] = true;
-                        next({
-                            name: shareUrl.split("_")[0],
-                            query: {
-                                id: shareUrl.split("_")[1],
-                                type: "isShare"
-                            }
-                        });
-                    } else {
-                        next();
-                    }
+                    resolve();
                 })
                 .catch(e => {
                     if (e.status != 401) {
-                        next(false);
+                        reject(false);
                     } else if (is_weixn()) {
                         //微信登录
                         wxLogin()
                             .then(_ => {
-                                next("/home");
+                                reject({
+                                    path: to.path,
+                                    replace: true
+                                });
                             })
                             .catch(e => {
-                                console.log(e);
-                                next(false);
+                                reject(false);
                                 getCode();
                             });
                     } else if (process.env.VUE_APP_ENV === "production") {
                         //正式环境走正常的登录
                         localStorage.removeItem("token");
-                        next("/login");
+                        reject({
+                            path: "/login",
+                            replace: true
+                        });
                     } else {
                         //开发直接登录测试账户
                         localStorage.removeItem("token");
                         getLogin().then(_ => {
-                            next("/home");
+                            resolve();
                         });
                     }
                 });
         } else {
-            next();
+            resolve();
         }
-    }
-});
-router.afterEach((to, from) => {
-    Toast.clear();
-});
+    });
+}
 
 function is_weixn() {
     var ua = navigator.userAgent.toLowerCase();
@@ -354,7 +381,7 @@ function getUserInfo() {
             .get("/user/my")
             .then(res => {
                 userInfo = res;
-                return http.axios.get("/vipUser/my");
+                return http.axios.get("/vipUser/my", {}, true);
             })
             .then(res => {
                 if (res) {

+ 16 - 11
src/main/maskMall/src/views/Detail.vue

@@ -67,7 +67,7 @@
             <van-tabs
                 v-model="tab"
                 sticky
-                :offset-top="showBar ? 0 : 45"
+                :offset-top="showBar ? 45 : 0"
                 line-width="30"
                 :border="false"
             >
@@ -132,7 +132,7 @@
             </div>
 
             <div class="right">
-                <div class="price">{{ goodsInfo.price }}</div>
+                <div class="price">{{ goodsInfo.vipPrice }}</div>
                 <div class="text2">库存:{{ goodsInfo.inventory }}</div>
             </div>
             <van-cell title="数量:">
@@ -315,7 +315,7 @@ export default {
                 res.goods.vipPrice = res.goods.vipPrice.toFixed(2);
                 res.goods.price = res.goods.price.toFixed(2);
                 this.goodsInfo = res.goods;
-                this.changeTitle()
+                this.changeTitle();
                 this.detailList = res.goodsInformation;
                 if (res.highRate) {
                     this.evaluate = Number(res.highRate);
@@ -342,14 +342,11 @@ export default {
                             res.goods.name, // 分享标题
                         desc: "会员价仅需:" + res.goods.vipPrice, // 分享描述
                         link:
-                            "http://imshop.izouma.com?shareUrl=" +
+                            window.location.origin +
+                            "/mp?shareUrl=" +
                             encodeURI("detail_" + this.$route.query.id) +
                             "&shareTitle=" +
-                            encodeURI(
-                                this.userInfo.nickname +
-                                    "分享的" +
-                                    res.goods.name
-                            ), // 分享链接,该链接域名或路径必须与当前页面对应的公众号JS安全域名一致
+                            encodeURI(this.userInfo.nickname), // 分享链接,该链接域名或路径必须与当前页面对应的公众号JS安全域名一致
                         imgUrl: res.goods.icon[0]
                     });
                 });
@@ -373,9 +370,17 @@ export default {
         changeTitle() {
             if (this.$route.query.type === "isShare") {
                 this.$store.commit("updateShowBar", "home");
-                this.$store.commit("updateTitle", sessionStorage["shareTitle"]);
+                this.$store.commit(
+                    "updateTitle",
+                    sessionStorage["shareTitle"] +
+                        "分享的" +
+                        this.goodsInfo.name
+                );
             } else {
-                this.$store.commit("updateTitle", this.goodsInfo.name||'商品详情');
+                this.$store.commit(
+                    "updateTitle",
+                    this.goodsInfo.name || "商品详情"
+                );
             }
         },
         getGoodsList() {

+ 71 - 37
src/main/maskMall/src/views/Setting.vue

@@ -3,7 +3,14 @@
         <van-cell-group>
             <van-uploader :after-read="afterRead" style="width:100%">
                 <van-cell title="头像" value="内容" isLink style="width:100%">
-                    <van-image class="user-icon" width="36" height="36" fit="fill" radius="100" :src="myUser.avatar" />
+                    <van-image
+                        class="user-icon"
+                        width="36"
+                        height="36"
+                        fit="fill"
+                        radius="100"
+                        :src="myUser.avatar"
+                    />
                 </van-cell>
             </van-uploader>
             <van-cell
@@ -23,63 +30,83 @@
 
         <van-cell-group>
             <!-- <van-cell :class="{notSet:!birth}" title="出生日期" :value="birth?dateFormatter(birth):'请选择出生日期'" @click="showTime=true" isLink /> -->
-            <van-cell
-                title="收货地址"
-                @click="goNext('addressList')"
-                isLink
-            />
+            <van-cell title="收货地址" @click="goNext('addressList')" isLink />
         </van-cell-group>
 
         <van-cell-group>
-            <van-cell class="notSet" title="绑定手机号" value="已绑定" @click="goNext('bindPhone')" isLink />
+            <van-cell
+                title="绑定手机号"
+                :class="[myUser.phone ? 'bind' : 'notSet']"
+                :value="myUser.phone ? '已绑定' : '未绑定'"
+                @click="goNext('bindPhone')"
+                isLink
+            />
         </van-cell-group>
 
-        <div class="submit-btn" >
-            <van-button type="primary" size="large" round style="margin-top:50px" @click="logout">退出登录</van-button>
+        <div class="submit-btn" v-if="showBar">
+            <van-button
+                type="primary"
+                size="large"
+                round
+                style="margin-top:50px"
+                @click="logout"
+                >退出登录</van-button
+            >
         </div>
 
-      
-
         <van-popup v-model="showName" position="bottom">
             <div class="change-content">
-                <van-field class="nickname-field" v-model="nameVal" label="昵称" placeholder="请输入昵称" />
-                <van-button type="primary" round @click="sureName">确定</van-button>
+                <van-field
+                    class="nickname-field"
+                    v-model="nameVal"
+                    label="昵称"
+                    placeholder="请输入昵称"
+                />
+                <van-button type="primary" round @click="sureName"
+                    >确定</van-button
+                >
             </div>
         </van-popup>
 
-        <van-action-sheet v-model="showSex" :actions="actions" @select="onSelect" cancel-text="取消" />
+        <van-action-sheet
+            v-model="showSex"
+            :actions="actions"
+            @select="onSelect"
+            cancel-text="取消"
+        />
     </div>
 </template>
 <script>
-import { mapState } from 'vuex';
-import areaList from '../areaList';
+import { mapState } from "vuex";
+import areaList from "../areaList";
 export default {
-    name: 'setting',
+    name: "setting",
     data() {
         return {
             areaList,
             show: false,
             showTime: false,
-            address: '',
-            birth: '',
-            sex: '',
+            address: "",
+            birth: "",
+            sex: "",
             maxDate: new Date(),
-            minDate: new Date('1960-01-01'),
+            minDate: new Date("1960-01-01"),
             date: new Date(),
-            actions: [{ name: '男' }, { name: '女' }],
+            actions: [{ name: "男" }, { name: "女" }],
             showSex: false,
             showName: false,
             myUser: {},
-            nameVal: ''
+            nameVal: ""
         };
     },
     computed: {
-        ...mapState(['userInfo', 'showBar'])
+        ...mapState(["userInfo", "showBar"])
     },
     mounted() {
         this.myUser = { ...this.userInfo };
         if (this.userInfo.country) {
-            this.myUser.address = this.userInfo.country + ' ' + this.userInfo.city;
+            this.myUser.address =
+                this.userInfo.country + " " + this.userInfo.city;
         }
     },
     methods: {
@@ -116,16 +143,17 @@ export default {
                 id: this.userInfo.id
             };
             this.$http
-                .post('/user/save', data, { body: 'json' })
+                .post("/user/save", data, { body: "json" })
                 .then(res => {
-                    return this.$http.get('/user/my');
+                    return this.$http.get("/user/my");
                 })
                 .then(res => {
-                    this.$store.commit('updateUserInfo', res);
+                    this.$store.commit("updateUserInfo", res);
                     this.myUser = { ...this.userInfo };
-                    this.$toast.success('修改成功');
+                    this.$toast.success("修改成功");
                     if (this.userInfo.country) {
-                        this.myUser.address = this.userInfo.country + ' ' + this.userInfo.city;
+                        this.myUser.address =
+                            this.userInfo.country + " " + this.userInfo.city;
                     }
                 })
                 .catch(e => {
@@ -141,7 +169,7 @@ export default {
         },
         afterRead(file, name) {
             this.$http
-                .post('/upload/base64', {
+                .post("/upload/base64", {
                     base64: file.content
                 })
                 .then(res => {
@@ -152,9 +180,9 @@ export default {
                 });
         },
         logout() {
-            localStorage.removeItem('token');
-            this.$store.commit('updateUserInfo', {});
-            this.goNext('login');
+            localStorage.removeItem("token");
+            this.$store.commit("updateUserInfo", {});
+            this.goNext("login");
         }
     }
 };
@@ -162,7 +190,7 @@ export default {
 <style lang="less" scoped>
 .setting {
     background: rgba(242, 244, 245, 1);
-    padding:5px 0 15px;
+    padding: 5px 0 15px;
 }
 
 .van-cell-group {
@@ -188,11 +216,17 @@ export default {
     .van-cell:not(:last-child)::after {
         right: 15px;
     }
+    .bind {
+        .van-cell__value {
+            font-size: 13px;
+            color: #aaacad;
+        }
+    }
 
     .notSet {
         .van-cell__value {
             font-size: 13px;
-            color: #aaacad;
+            color: #b81c22;
         }
     }
 }
@@ -217,7 +251,7 @@ export default {
     }
 }
 
-.submit-btn{
+.submit-btn {
     padding: 15px;
 }
 </style>

+ 8 - 8
src/main/maskMall/src/views/ShoppingCart.vue

@@ -2,7 +2,7 @@
     <div class="shopping index">
         <div class="index-router-view main">
             <div class="color">
-                <van-sticky :offset-top="showBar ? 0 : 45">
+                <van-sticky :offset-top="showBar ? 45 : 0">
                     <div class="top">
                         <div>共{{ checkList.length }}件商品</div>
                         <div @click="edit = !edit">
@@ -10,12 +10,6 @@
                         </div>
                     </div>
                 </van-sticky>
-                <!-- <div class="activity">
-            <img class="icon" src="../assets/icon_manjian.png" alt="" />
-            <span class="title">满1000减200,还差50元</span>
-            <span class="btn">去凑单</span>
-            <img src="../assets/icon_inter_huang.png" alt="" class="more" />
-        </div> -->
                 <div class="list">
                     <template v-if="carList.length > 0">
                         <div
@@ -173,7 +167,6 @@ export default {
                 })
                 .then(res => {
                     this.loading = false;
-                    console.log(res);
                     var carList = [...this.carList];
                     res.forEach((item, index) => {
                         if (carList.length > 0) {
@@ -181,6 +174,8 @@ export default {
                         } else {
                             item.checked = false;
                         }
+                        item.price=item.price.toFixed(2)
+                        item.vipPrice=item.vipPrice.toFixed(2)
                     });
                     this.carList = res;
                 })
@@ -323,4 +318,9 @@ export default {
     display: flex;
     flex-direction: column;
 }
+
+.van-checkbox{
+    overflow: hidden;
+    display: flex;
+}
 </style>

+ 260 - 185
src/main/maskMall/src/views/User.vue

@@ -1,215 +1,290 @@
 <template>
-  <div class="user">
-    <div class="top">
-      <van-image class="user-icon" width="60" height="60" fit="fill" radius="100" :src="userInfo.avatar" />
-      <div class="user-name">{{ userInfo.nickname }}</div>
-      <!-- <div class="code">我的邀请码:16523516</div> -->
-      
-    </div>
+    <div class="user">
+        <div class="top">
+            <van-image
+                class="user-icon"
+                width="60"
+                height="60"
+                fit="fill"
+                radius="100"
+                :src="userInfo.avatar"
+            />
+            <div class="user-name">{{ userInfo.nickname }}</div>
+            <!-- <div class="code">我的邀请码:16523516</div> -->
+        </div>
 
-    <div class="order">
-      <van-cell style="padding:30px 15px 10px;" title-class="order-title" value-class="order-val" title="我的订单" is-link value="查看全部" @click="goNext('orderList')" />
-      <van-grid class="order-menu" :column-num="4" :border="false">
-        <van-grid-item @click="goNext('orderList', { chooseTab: 1 })">
-          <div class="grid-info">
-            <img src="../assets/info_icon_dingdan_daifahuo.png" class="order-img" alt />
-            <div class="text">待付款</div>
-            <div class="tag" v-if="badge.NOT_PAID">{{ badge.NOT_PAID }}</div>
-          </div>
-        </van-grid-item>
-        <van-grid-item text="待发货" @click="goNext('orderList', { chooseTab: 2 })">
-          <div class="grid-info">
-            <img src="../assets/info_icon_dingdan_daifukuan.png" class="order-img" alt />
-            <div class="text">待发货</div>
-            <div class="tag" v-if="badge.NOT_CONFIRMED">{{ badge.NOT_CONFIRMED }}</div>
-          </div>
-        </van-grid-item>
-        <van-grid-item text="待收货" @click="goNext('orderList', { chooseTab: 3 })">
-          <div class="grid-info">
-            <img src="../assets/info_icon_dingdan_daishouhuo.png" class="order-img" alt />
-            <div class="text">待收货</div>
-            <div class="tag" v-if="badge.CONFIRMED">{{ badge.CONFIRMED }}</div>
-          </div>
-        </van-grid-item>
-
-        <van-grid-item text="待评价" @click="goNext('orderList', { chooseTab: 3 })">
-          <div class="grid-info">
-            <img src="../assets/info_icon_dingdan_daipingjia.png" class="order-img" alt />
-            <div class="text">待评价</div>
-            <div class="tag" v-if="badge.CONFIRMED">{{ badge.CONFIRMED }}</div>
-          </div>
-        </van-grid-item>
-      </van-grid>
-    </div>
+        <div class="order">
+            <van-cell
+                style="padding:30px 15px 10px;"
+                title-class="order-title"
+                value-class="order-val"
+                title="我的订单"
+                is-link
+                value="查看全部"
+                @click="goNext('orderList')"
+            />
+            <van-grid class="order-menu" :column-num="4" :border="false">
+                <van-grid-item @click="goNext('orderList', { chooseTab: 1 })">
+                    <div class="grid-info">
+                        <img
+                            src="../assets/info_icon_dingdan_daifukuan.png"
+                            class="order-img"
+                            alt
+                        />
+                        <div class="text">待付款</div>
+                        <div class="tag" v-if="badge.NOT_PAID">
+                            {{ badge.NOT_PAID }}
+                        </div>
+                    </div>
+                </van-grid-item>
+                <van-grid-item
+                    text="待发货"
+                    @click="goNext('orderList', { chooseTab: 2 })"
+                >
+                    <div class="grid-info">
+                        <img
+                            src="../assets/info_icon_dingdan_daifahuo.png"
+                            class="order-img"
+                            alt
+                        />
+                        <div class="text">待发货</div>
+                        <div class="tag" v-if="badge.NOT_CONFIRMED">
+                            {{ badge.NOT_CONFIRMED }}
+                        </div>
+                    </div>
+                </van-grid-item>
+                <van-grid-item
+                    text="待收货"
+                    @click="goNext('orderList', { chooseTab: 3 })"
+                >
+                    <div class="grid-info">
+                        <img
+                            src="../assets/info_icon_dingdan_daishouhuo.png"
+                            class="order-img"
+                            alt
+                        />
+                        <div class="text">待收货</div>
+                        <div class="tag" v-if="badge.CONFIRMED">
+                            {{ badge.CONFIRMED }}
+                        </div>
+                    </div>
+                </van-grid-item>
 
-    <div class="menu-list">
+                <van-grid-item
+                    text="待评价"
+                    @click="goNext('orderList', { chooseTab: 3 })"
+                >
+                    <div class="grid-info">
+                        <img
+                            src="../assets/info_icon_dingdan_daipingjia.png"
+                            class="order-img"
+                            alt
+                        />
+                        <div class="text">待评价</div>
+                        <div class="tag" v-if="badge.CONFIRMED">
+                            {{ badge.CONFIRMED }}
+                        </div>
+                    </div>
+                </van-grid-item>
+            </van-grid>
+        </div>
 
-      <van-cell-group :border="false" >
-        <!-- <van-cell title="我的优惠券" title-class="menu-title" @click="goNext('collection')" is-link>
+        <div class="menu-list">
+            <van-cell-group :border="false">
+                <!-- <van-cell title="我的优惠券" title-class="menu-title" @click="goNext('collection')" is-link>
           <img src="../assets/info_icon_list_01(1).png" class="menu-img" slot="icon" alt />
         </van-cell> -->
-        <van-cell title="帮助中心" title-class="menu-title" @click="goNext('rule')" is-link>
-          <img src="../assets/info_icon_list_01.png" class="menu-img" slot="icon" alt />
-        </van-cell>
-          <van-cell title="联系客服" title-class="menu-title" @click="takephone" is-link>
-          <img src="../assets/info_icon_list_01(2).png" class="menu-img" slot="icon" alt />
-        </van-cell>
-        <van-cell title="资料设置" title-class="menu-title" @click="goNext('setting')" is-link>
-          <img src="../assets/info_icon_list_01(3).png" class="menu-img" slot="icon" alt />
-        </van-cell>
-      </van-cell-group>
+                <van-cell
+                    title="帮助中心"
+                    title-class="menu-title"
+                    @click="goNext('rule')"
+                    is-link
+                >
+                    <img
+                        src="../assets/info_icon_list_01.png"
+                        class="menu-img"
+                        slot="icon"
+                        alt
+                    />
+                </van-cell>
+                <van-cell
+                    title="联系客服"
+                    title-class="menu-title"
+                    @click="takephone"
+                    is-link
+                >
+                    <img
+                        src="../assets/info_icon_list_01(2).png"
+                        class="menu-img"
+                        slot="icon"
+                        alt
+                    />
+                </van-cell>
+                <van-cell
+                    title="资料设置"
+                    title-class="menu-title"
+                    @click="goNext('setting')"
+                    is-link
+                >
+                    <img
+                        src="../assets/info_icon_list_01(3).png"
+                        class="menu-img"
+                        slot="icon"
+                        alt
+                    />
+                </van-cell>
+            </van-cell-group>
+        </div>
     </div>
-  </div>
 </template>
 <script>
-import { mapState } from 'vuex'
+import { mapState } from "vuex";
 export default {
-  name: '',
-  data() {
-    return {
-      hasAddress: false,
-      badge: {}
+    name: "",
+    data() {
+        return {
+            hasAddress: false,
+            badge: {}
+        };
+    },
+    computed: {
+        ...mapState(["userInfo", "showBar"])
+    },
+    mounted() {
+        // this.$http.get('/address/all').then(res => {
+        //     if (res.content.length > 0) {
+        //         this.hasAddress = true;
+        //     }
+        // });
+        // this.$http.get('/order/badge').then(res => {
+        //     this.badge = res;
+        // });
+    },
+    methods: {
+        bindAli() {
+            window.location.href =
+                location.origin + "/alipay/auth?userId=" + this.userInfo.id;
+        }
     }
-  },
-  computed: {
-    ...mapState(['userInfo', 'showBar'])
-  },
-  mounted() {
-    // this.$http.get('/address/all').then(res => {
-    //     if (res.content.length > 0) {
-    //         this.hasAddress = true;
-    //     }
-    // });
-    // this.$http.get('/order/badge').then(res => {
-    //     this.badge = res;
-    // });
-  },
-  methods: {
-    bindAli() {
-      window.location.href =
-        location.origin + '/alipay/auth?userId=' + this.userInfo.id
-    }
-  }
-}
+};
 </script>
 <style lang="less" scoped>
 .user {
-  position: relative;
+    position: relative;
 }
 .top {
-  height: 120px;
-  background: rgba(184, 28, 34, 1);
-  border-radius: 8px;
-  margin: 45px 15px 0;
-  padding: 43px 0 0;
-  display: flex;
-  flex-direction: column;
-  align-items: center;
-  box-sizing: border-box;
-
-  .user-icon {
-    position: absolute;
-    left: 50%;
-    transform: translateX(-50%);
-    top: 15px;
-  }
-
-  .user-name {
-    font-size: 18px;
-    font-weight: bold;
-    color: rgba(255, 255, 255, 1);
-    line-height: 25px;
-  }
-
-  .code {
-    font-size: 12px;
-    color: rgba(255, 255, 255, 1);
-    line-height: 17px;
-    margin-top: 11px;
-  }
+    height: 100px;
+    background: rgba(184, 28, 34, 1);
+    border-radius: 8px;
+    margin: 45px 15px 0;
+    padding: 45px 0 0;
+    display: flex;
+    flex-direction: column;
+    align-items: center;
+    box-sizing: border-box;
+
+    .user-icon {
+        position: absolute;
+        left: 50%;
+        transform: translateX(-50%);
+        top: 15px;
+    }
+
+    .user-name {
+        font-size: 18px;
+        font-weight: bold;
+        color: rgba(255, 255, 255, 1);
+        line-height: 25px;
+    }
+
+    .code {
+        font-size: 12px;
+        color: rgba(255, 255, 255, 1);
+        line-height: 17px;
+        margin-top: 11px;
+    }
 }
 
 .order {
-  height: 140px;
-  background: rgba(255, 255, 255, 1);
-  border-radius: 4px;
-//   overflow: hidden;
-
-  .order-title {
-    font-size: 20px;
-    font-weight: bold;
-    color: rgba(0, 0, 0, 1);
-  }
-
-  .order-val {
-    font-size: 13px;
-    color: rgba(153, 153, 153, 1);
-  }
-
-  .order-img {
-    width: 30px;
-    height: 30px;
-    display: block;
-    margin-bottom: 3px;
-  }
-  .text {
-    font-size: 13px;
-    color: rgba(26, 26, 26, 1);
-    line-height: 18px;
-  }
+    background: rgba(255, 255, 255, 1);
+    border-radius: 4px;
+    //   overflow: hidden;
+
+    .order-title {
+        font-size: 20px;
+        font-weight: bold;
+        color: rgba(0, 0, 0, 1);
+    }
+
+    .order-val {
+        font-size: 13px;
+        color: rgba(153, 153, 153, 1);
+    }
+
+    .order-img {
+        width: 30px;
+        height: 30px;
+        display: block;
+        margin-bottom: 3px;
+    }
+    .text {
+        font-size: 13px;
+        color: rgba(26, 26, 26, 1);
+        line-height: 18px;
+    }
 }
 
 .menu-list {
-  margin: 20px 0 0;
-  background-color: #f7f9fa;
-
-  .menu-img {
-    width: 24px;
-    height: 24px;
-    margin-right: 10px;
-  }
-
-  .menu-title {
-    font-size: 14px;
-    color: rgba(0, 0, 0, 1);
-  }
-
-  .menu-not-val {
-    font-size: 13px;
-    color: rgba(255, 143, 0, 1);
-  }
+    margin: 20px 0 0;
+    background-color: #f7f9fa;
+
+    .menu-img {
+        width: 24px;
+        height: 24px;
+        margin-right: 10px;
+    }
+
+    .menu-title {
+        font-size: 14px;
+        color: rgba(0, 0, 0, 1);
+    }
+
+    .menu-not-val {
+        font-size: 13px;
+        color: rgba(255, 143, 0, 1);
+    }
 }
 
 .grid-info {
-  display: flex;
-  flex-direction: column;
-  align-items: center;
-  position: relative;
-
-  .tag {
-    min-width: 17px;
-    height: 17px;
-    background: rgba(255, 39, 0, 1);
-    border-radius: 17px;
-    font-size: 12px;
-    font-weight: bold;
-    color: rgba(255, 255, 255, 1);
-    line-height: 17px;
-    padding: 0 2px;
-    position: absolute;
-    right: 0;
-    top: -5px;
-    text-align: center;
-    box-sizing: border-box;
-    // transform: translateX(50%);
-  }
+    display: flex;
+    flex-direction: column;
+    align-items: center;
+    position: relative;
+
+    .tag {
+        min-width: 17px;
+        height: 17px;
+        background: rgba(255, 39, 0, 1);
+        border-radius: 17px;
+        font-size: 12px;
+        font-weight: bold;
+        color: rgba(255, 255, 255, 1);
+        line-height: 17px;
+        padding: 0 2px;
+        position: absolute;
+        right: 0;
+        top: -5px;
+        text-align: center;
+        box-sizing: border-box;
+        // transform: translateX(50%);
+    }
 }
 
 .order-menu {
-  margin: 0 15px;
-  background: rgba(255, 255, 255, 1);
-  box-shadow: 0px 4px 8px 0px rgba(0, 0, 0, 0.1);
-  border-radius: 8px;
-  padding: 4px 0;
+    margin: 0 15px;
+    background: rgba(255, 255, 255, 1);
+    box-shadow: 0px 4px 8px 0px rgba(0, 0, 0, 0.1);
+    border-radius: 8px;
+    padding: 4px 0;
 }
 </style>

+ 1 - 1
src/main/maskMall/src/views/order/OrderList.vue

@@ -1,6 +1,6 @@
 <template>
     <div class="list">
-        <van-sticky :offset-top="showBar ? 0 : 45">
+        <van-sticky :offset-top="showBar ? 45 : 0">
             <van-tabs
                 v-model="chooseTab"
                 title-active-color="#B81C22"

+ 1 - 1
src/main/maskMall/src/views/order/OrderStatus.vue

@@ -1,6 +1,6 @@
 <template>
     <div class="list">
-        <van-sticky :offset-top="showBar ? 0 : 45">
+        <van-sticky :offset-top="showBar ? 45 : 0">
             <van-tabs
                 v-model="chooseTab"
                 title-active-color="#FF7900"

+ 22 - 26
src/main/maskMall/src/views/order/Submit.vue

@@ -52,7 +52,7 @@
             />
 
             <div v-for="item in goodsList" :key="item.id">
-                <order-info :info="item" :isVip='isVip'></order-info>
+                <order-info :info="item" :isVip="isVip"></order-info>
             </div>
 
             <div
@@ -163,7 +163,10 @@ export default {
                     if (item.price && item.amount) {
                         money = this.addNum(
                             money,
-                            this.mul(Number(this.isVip?item.vipPrice:item.price), Number(item.amount))
+                            this.mul(
+                                Number(this.isVip ? item.vipPrice : item.price),
+                                Number(item.amount)
+                            )
                         );
                     }
                 });
@@ -185,6 +188,7 @@ export default {
     },
     mounted() {
         if (this.$route.query.goodsId) {
+            //普通购买
             this.$http
                 .get("/goods/get/" + this.$route.query.goodsId)
                 .then(res => {
@@ -192,9 +196,18 @@ export default {
                     this.goodsList.push(res);
                 });
         } else if (this.$route.query.cartIds) {
-            console.log(this.$route.query.cartIds);
-            this.getCar(0);
+            this.$http
+                .get("/cart/showCartsByIds", {
+                    ids: this.$route.query.cartIds
+                })
+                .then(res => {
+                    res.forEach(item => {
+                        item.amount = item.piece;
+                        this.goodsList.push(item);
+                    });
+                });
         } else if (this.$route.query.SetId) {
+            //购买套餐
             let price = {};
             this.$http
                 .get("/goods/get/" + this.$route.query.SetId)
@@ -210,6 +223,7 @@ export default {
                     this.goodsList.push(res);
                 });
         } else if (this.$route.query.userSetId) {
+            //套餐内商品
             this.$http
                 .get("/userSet/showMyUserSet/" + this.$route.query.userSetId)
                 .then(res => {
@@ -267,19 +281,6 @@ export default {
         }
     },
     methods: {
-        getCar(index) {
-            var idList = this.$route.query.cartIds.split(",");
-            if (idList.length <= index) {
-                return;
-            }
-            this.$http.get("/cart/get/" + idList[index]).then(res => {
-                res.id = idList[index];
-                this.cartList.push({ ...res });
-                res.amount = res.piece;
-                this.goodsList.push(res);
-                return this.getCar(index + 1);
-            });
-        },
         submit() {
             if (this.orderId) {
                 this.buy();
@@ -298,8 +299,6 @@ export default {
                     goodsId: this.$route.query.goodsId,
                     addressId: this.chooseAddressId,
                     piece: this.$route.query.amount,
-                    cartIds: [],
-                    benefitId: "",
                     type: "NORMAL"
                 };
             } else if (this.$route.query.cartIds) {
@@ -308,10 +307,7 @@ export default {
                     userId: this.userInfo.id,
                     addressId: this.chooseAddressId,
                     carts: this.cartList,
-                    benefitId: "",
-                    piece: "",
-                    goodsId: "",
-                    cartIds: this.$route.query.cartIds
+                    cartIds: idList
                 };
             } else if (this.$route.query.SetId) {
                 data = {
@@ -319,8 +315,6 @@ export default {
                     addressId: this.chooseAddressId,
                     goodsId: this.$route.query.SetId,
                     piece: 1,
-                    cartIds: [],
-                    benefitId: "",
                     type: "SET"
                 };
             }
@@ -362,7 +356,9 @@ export default {
             } else {
                 data.remark = this.message || "无";
                 this.$http
-                    .post("/orderForm/createOrderForm", data)
+                    .post("/orderForm/createOrderForm", data, {
+                        body: "json"
+                    })
                     .then(res => {
                         this.orderId = res.id;
                         this.buy();

+ 85 - 41
src/main/maskMall/src/views/vip/Extension.vue

@@ -1,45 +1,52 @@
 <template>
     <div class="extension index">
-       <div class="index-router-view">
+        <div class="index-router-view">
             <div class="poster" id="canvas" v-if="!showCanvas">
-            <img src="../../assets/haibao.png" class="bg" alt="" />
-            <div class="bottom">
-                <div class="left">
-                    <div class="user">
-                        <van-image
-                            class="user-icon"
-                            width="24"
-                            height="24"
-                            fit="cover"
-                            radius="100"
-                            :src="userInfo.avatar"
-                        />
-                        <div class="user-name">
-                            我是<span>{{ userInfo.nickname }}</span>
+                <img src="../../assets/haibao.png" class="bg" alt="" />
+                <div class="bottom">
+                    <div class="left">
+                        <div class="user">
+                            <van-image
+                                class="user-icon"
+                                width="24"
+                                height="24"
+                                fit="cover"
+                                radius="100"
+                                :src="userInfo.avatar"
+                            />
+                            <div class="user-name">
+                                <span>{{ userInfo.nickname }}</span>
+                                <span style="margin-left:5px"
+                                    >给你推荐超值商品</span
+                                >
+                            </div>
+                        </div>
+                        <div class="left-text">
+                            <div class="money">
+                                <div class="price">49.90</div>
+                                <div class="original">88.00</div>
+                            </div>
+                            <div class="title">JM网红爆品蜂胶面膜</div>
                         </div>
                     </div>
-                    <div class="left-text">
-                        <div>快来和我一起</div>
-                        <div>免费领面膜吧</div>
-                    </div>
-                </div>
 
-                <div class="right">
-                    <qrcode
-                        class="qrcode"
-                        :value="url"
-                        :margin="2"
-                        :width="88"
-                    />
-                    <div class="right-text">
-                        长按识别二维码
+                    <div class="right">
+                        <qrcode
+                            class="qrcode"
+                            :value="url"
+                            :margin="2"
+                            :width="88"
+                            errorCorrectionLevel="H"
+                        />
+                        <div class="right-text">
+                            长按识别二维码
+                        </div>
                     </div>
                 </div>
             </div>
-        </div>
 
-        <div ref="post"></div>
-       </div>
+            <div ref="post"></div>
+        </div>
 
         <div class="bottom" style="height:60px;">
             <van-goods-action>
@@ -59,7 +66,7 @@ export default {
     name: "extension",
     data() {
         return {
-            url: "",
+            url: window.location.origin,
             showCanvas: false
         };
     },
@@ -70,7 +77,16 @@ export default {
         Qrcode
     },
     mounted() {
-        this.url = window.location.origin + "/?invitor=" + this.userInfo.id;
+        this.url =
+            window.location.origin +
+            "/mp?shareUrl=" +
+            encodeURI("detail_1551") +
+            "&shareTitle=" +
+            encodeURI(
+                this.userInfo.nickname
+            ) +
+            "&invitor=" +
+            this.userInfo.id;
 
         setTimeout(() => {
             let post = document.getElementById("canvas");
@@ -151,13 +167,41 @@ export default {
             }
 
             .left-text {
-                font-size: 28px;
-                font-weight: lighter;
-                color: rgba(26, 26, 26, 1);
-                line-height: 30px;
-                margin-top: 12px;
-                div {
-                    margin-bottom: 8px;
+                margin-top: 19px;
+                .money {
+                    display: flex;
+                    align-items: center;
+                    align-items: flex-end;
+                    .price {
+                        font-size: 26px;
+                        font-weight: bold;
+                        color: rgba(184, 28, 34, 1);
+                        line-height: 26px;
+                        &::before {
+                            content: "¥";
+                            font-size: 15px;
+                            line-height: 18px;
+                        }
+                    }
+
+                    .original {
+                        font-size: 12px;
+                        font-weight: lighter;
+                        color: rgba(98, 99, 102, 1);
+                        line-height: 17px;
+                        text-decoration: line-through;
+                        margin-left: 5px;
+                        &::before {
+                            content: "¥";
+                        }
+                    }
+                }
+                .title {
+                    font-size: 23px;
+                    font-weight: lighter;
+                    color: rgba(26, 26, 26, 1);
+                    line-height: 30px;
+                    margin-top: 10px;
                 }
             }
         }

+ 1 - 1
src/main/maskMall/src/views/vip/Team.vue

@@ -16,7 +16,7 @@
                 />
                 <div class="user">
                     <div class="name">{{ item.nickname }}</div>
-                    <div class="time">{{ item.phone }}</div>
+                    <div class="time">{{ item.phone||'***' }}</div>
                 </div>
             </div>
         </div>

+ 75 - 121
src/main/maskMall/src/views/vip/VipCenter.vue

@@ -1,73 +1,14 @@
 <template>
-    <div class="vip">
-        <div class="top">
-            <div class="text1">
-                <span>{{ userInfo.money || 0 }}</span>
-                <span>元</span>
-            </div>
-            <div class="text2">我的佣金</div>
-            <div class="btn-list">
-                <van-button
-                    color="#B81C22"
-                    size="small"
-                    @click="goNext('withdrawal')"
-                    >提现</van-button
-                >
-                <van-button
-                    color="rgba(184,28,34,0.1)"
-                    size="small"
-                    @click="goNext('moneyList')"
-                    ><span style="color:#B81C22">明细</span></van-button
-                >
-            </div>
-        </div>
-
-        <div class="menu-list">
-            <div class="menu-item" @click="goNext('team')">
-                <img src="../../assets/fenxiao_icon_fensi.png" alt />
-                <div class="right">
-                    <div class="text1">我的团队</div>
-                    <div class="text2">{{ userInfo.fansNum }}位</div>
-                </div>
-            </div>
-
-            <div class="menu-item" @click="goNext('extension')">
-                <img src="../../assets/fenxiao_icon_tuiguang.png" alt />
-                <div class="right">
-                    <div class="text1">推广海报</div>
-                    <div class="text2">分享营销</div>
-                </div>
-            </div>
-        </div>
-
-        <div class="vip-product">
-            <van-tabs
-                v-model="activeName"
-                :swipe-threshold="5"
-                :line-width="34"
-                :line-height="4"
-                title-active-color="#B81C22"
-                :border="false"
-            >
-                <van-tab
-                    :title="item.goodsInfo.name"
-                    v-for="item in vipList"
-                    :key="item.id"
-                >
-                    <vip-goods-panel
-                        hasBtn
-                        :info="item"
-                        :time="item.time"
-                        @getInfo="getInfo"
-                    ></vip-goods-panel>
-                </van-tab>
-            </van-tabs>
-        </div>
+    <div>
+        <vipCenter v-if="vipInfo.id"></vipCenter>
+        <vipCenterNo v-else></vipCenterNo>
     </div>
 </template>
 <script>
 import { mapState } from "vuex";
-import vipGoodsPanel from "../../components/VipGoodsPanel";
+import vipCenter from "../../components/VipCenter";
+import vipCenterNo from "../../components/VipCenterNo";
+import { parse, addYears, format } from "date-fns";
 export default {
     name: "vip",
     data() {
@@ -78,43 +19,62 @@ export default {
         };
     },
     computed: {
-        ...mapState(["userInfo"])
-    },
-    created() {
-        this.getInfo();
-    },
-    methods: {
-        getInfo() {
-            this.$http
-                .get("/userSet/all", {
-                    query: {
-                        userId: this.userInfo.id
-                    }
-                })
-                .then(res => {
-                    this.vipList = res.content;
-                });
+        ...mapState(["userInfo"]),
+        vipInfo() {
+            return this.userInfo.vipInfo || {};
+        },
+        time() {
+            var time = this.vipInfo.startTime || "";
+            if (time) {
+                return format(
+                    addYears(parse(time, "yyyy-MM-dd HH:mm:ss", new Date()), 1),
+                    "yyyy-MM-dd"
+                );
+            } else {
+                return "";
+            }
+        },
+        money() {
+            var money = this.vipInfo.money || 0;
+            return money.toFixed(2);
         }
     },
+    created() {},
     components: {
-        vipGoodsPanel
+        vipCenter,
+        vipCenterNo
     }
 };
 </script>
 <style lang='less' scoped>
+@import "../../MyMixin.less";
 .vip {
     padding: 15px;
 }
+
+.vip-time {
+    position: relative;
+    .time {
+        position: absolute;
+        top: .mix-getVal(74px) [];
+        left: .mix-getVal(28px) [];
+        font-size: 14px;
+        font-weight: lighter;
+        color: rgba(124, 70, 51, 1);
+        line-height: 20px;
+        span {
+            margin-right: 10px;
+        }
+    }
+}
 .top {
     height: 150px;
-    background: linear-gradient(
-        90deg,
-        rgba(255, 223, 188, 1) 0%,
-        rgba(255, 216, 164, 1) 100%
-    );
+    background: rgba(255, 255, 255, 1);
+    box-shadow: 0px 2px 8px 0px rgba(0, 0, 0, 0.06);
     border-radius: 8px;
     padding: 30px;
     box-sizing: border-box;
+    margin-top: 20px;
 
     .text1 {
         span {
@@ -154,43 +114,37 @@ export default {
     margin-right: 10px;
 }
 
+.panel {
+    margin-top: 20px;
+}
+
 .menu-list {
-    display: flex;
-    padding: 25px 0 30px;
-    justify-content: space-between;
-    .menu-item {
-        display: flex;
-        align-items: center;
-        width: calc((100% - 15px) / 2);
-        height: 80px;
-        background: rgba(255, 255, 255, 1);
-        box-shadow: 0px 2px 8px 0px rgba(0, 0, 0, 0.06);
-        border-radius: 4px;
-        justify-content: center;
-        img {
-            width: 44px;
-            height: 44px;
-        }
+    margin: 20px 0 0;
+    background-color: #f7f9fa;
+    .van-cell {
+        line-height: 40px;
+        padding: 22px 15px 18px;
+    }
+    .menu-img {
+        width: 40px;
+        height: 40px;
+        margin-right: 12px;
+    }
 
-        .right {
-            margin-left: 10px;
-            .text1 {
-                font-size: 16px;
-                font-weight: bold;
-                color: rgba(51, 51, 51, 1);
-                line-height: 22px;
-            }
-            .text2 {
-                font-size: 14px;
-                color: rgba(142, 142, 147, 1);
-                line-height: 20px;
-                margin-top: 2px;
-            }
-        }
+    .menu-title {
+        font-size: 14px;
+        color: rgba(0, 0, 0, 1);
     }
-}
 
-.panel {
-    margin-top: 20px;
+    .menu-not-val {
+        font-size: 13px;
+        color: rgba(255, 143, 0, 1);
+    }
+
+    .menu-val {
+        font-size: 13px;
+        color: rgba(170, 171, 173, 1);
+        margin-right: 10px;
+    }
 }
 </style>