作者 lihongjuan

提交

要显示太多修改。

为保证性能只显示 62 of 62+ 个文件。

  1 +<script>
  2 + export default {
  3 + onLaunch: function() {
  4 + console.log('App Launch')
  5 + },
  6 + onShow: function() {
  7 + console.log('App Show')
  8 + },
  9 + onHide: function() {
  10 + console.log('App Hide')
  11 + },
  12 + post: function(url, data, method) {
  13 + var promise = new Promise((resolve, reject) => {
  14 + //init
  15 + let that = this,
  16 + token = uni.getStorageSync('token'),
  17 + header = {
  18 + 'token': token || ''
  19 + },
  20 + postData;
  21 + //网络请求
  22 + uni.request({
  23 + url: this.globalData.baseUrl + url,
  24 + data: data,
  25 + method: method,
  26 + header: header,
  27 + success: function(res) {
  28 + //返回取得的数据
  29 + if (res.data.code == '1') {
  30 + resolve(res.data.data);
  31 + } else {
  32 +
  33 + reject(res.data);
  34 + }
  35 + },
  36 + fail: function(e) {
  37 + reject('网络出错');
  38 + uni.hideNavigationBarLoading();
  39 + }
  40 + });
  41 + });
  42 + return promise;
  43 + },
  44 + globalData: {
  45 + userInfo: null,
  46 + baseUrl: 'http://knew.t.brotop.cn/api/',
  47 +
  48 + },
  49 +
  50 + }
  51 +</script>
  52 +
  53 +<style>
  54 + /*每个页面公共css */
  55 + /* 搜索 */
  56 + .nodata{
  57 + color:#999;
  58 + font-size: 32rpx;
  59 + text-align: center;
  60 + margin-top:100rpx
  61 + }
  62 + image{
  63 + width:100%;
  64 + height: 100%;
  65 + }
  66 + .searhtoppage{
  67 + width:100%;
  68 + background: #fff;
  69 + position: fixed;
  70 + top:0;
  71 + left:0;
  72 + z-index:99
  73 + }
  74 + .searchtop{
  75 + width: 688rpx;
  76 + height: 64rpx;
  77 + background: #f2f4f8;
  78 + border-radius: 32rpx;
  79 + padding: 14rpx 32rpx;
  80 + box-sizing: border-box;
  81 + margin:0 auto
  82 +
  83 + }
  84 + .searchtopk{
  85 + width: 608rpx;
  86 + height: 64rpx;
  87 + background: #f2f4f8;
  88 + border-radius: 32rpx;
  89 + padding: 14rpx 32rpx;
  90 + box-sizing: border-box;
  91 +
  92 + }
  93 + .cancelname{
  94 + color:#252F3E;
  95 + font-size: 32rpx;
  96 + font-weight: bold;
  97 + }
  98 + .searchleft{
  99 + color:#9B9B9B;
  100 + font-size:28rpx;
  101 + flex:1;
  102 + text-align: left;
  103 + padding-left: 20rpx;
  104 + }
  105 + .searchleft input{
  106 + width:100%
  107 + }
  108 + .search{
  109 + width:26rpx;
  110 + height: 26rpx;
  111 + }
  112 + .register {
  113 + width: 100%;
  114 + height: 100%;
  115 + background-color: rgba(0, 0, 0, 0.5);
  116 + position: fixed;
  117 + top: 0;
  118 + left: 0;
  119 + right: 0;
  120 + z-index: 999;
  121 + }
  122 +
  123 +
  124 + /* 右箭头 */
  125 + .more{
  126 + color:#707070;
  127 + font-size: 24rpx;
  128 + }
  129 + .yourow{
  130 + width:14rpx;
  131 + height: 14rpx;
  132 + margin-left:20rpx;
  133 + }
  134 +
  135 + .flex {
  136 + display: flex;
  137 + }
  138 +
  139 + .flexone {
  140 + display: flex;
  141 + align-items: center;
  142 + }
  143 +
  144 + .flextwo {
  145 + display: flex;
  146 + align-items: center;
  147 + justify-content: space-between;
  148 + }
  149 +
  150 + .flexthree {
  151 + display: flex;
  152 + align-items: center;
  153 + justify-content: center;
  154 + }
  155 +
  156 + .flexfour {
  157 + display: flex;
  158 + flex-direction: column;
  159 + align-items: center;
  160 + justify-content: center;
  161 + }
  162 + .flexfive {
  163 + display: flex;
  164 + flex-direction: column;
  165 + align-items: center;
  166 + justify-content: space-around;
  167 + }
  168 +
  169 +</style>
  1 +<template>
  2 + <view class="container">
  3 + <view class="goodkind flexone">
  4 +
  5 + <view class="goodkinditem" v-for="(item,index) in wantlist" :key="index" @click="sanji(item.id)">
  6 + <img :src="item.image" alt="" class="goodkindimg">
  7 + <view class="wantname">{{item.name}}</view>
  8 + </view>
  9 +
  10 + </view>
  11 + </view>
  12 +</template>
  13 +
  14 +<script>
  15 +
  16 + export default {
  17 + props: ["wantlist"],
  18 + data() {
  19 + return {
  20 +
  21 + }
  22 + },
  23 + onLoad() {
  24 + },
  25 + methods: {
  26 + sanji(id){
  27 + uni.navigateTo({
  28 + url:"/pages/xinyuan/sanjikind?sanid="+id
  29 + })
  30 + }
  31 +
  32 + }
  33 +
  34 + }
  35 +</script>
  36 +
  37 +<style>
  38 + @import url("../style/goodkind.css");
  39 +</style>
  1 +<template>
  2 + <view class="container">
  3 + <view class="goodkind flexone">
  4 +
  5 + <view class="goodkinditem" v-for="(item,index) in wantlistone" :key="index" @click="sanji(item.id)">
  6 + <img :src="item.image" alt="" class="goodkindimg">
  7 + <view class="wantname">{{item.name}}</view>
  8 + </view>
  9 +
  10 + </view>
  11 + </view>
  12 +</template>
  13 +
  14 +<script>
  15 +
  16 + export default {
  17 + props: ["wantlistone"],
  18 + data() {
  19 + return {
  20 +
  21 + }
  22 + },
  23 + onLoad() {
  24 +
  25 +
  26 +
  27 + },
  28 + methods: {
  29 + sanji(id){
  30 + uni.navigateTo({
  31 + url:"/pages/xinyuan/sanjikind?sanid="+id
  32 + })
  33 + }
  34 +
  35 + }
  36 +
  37 + }
  38 +</script>
  39 +
  40 +<style>
  41 + @import url("../style/goodkind.css");
  42 +</style>
  1 +<template>
  2 + <view class="container">
  3 + <view class="goodlist">
  4 + <view class="goodlistitem flex" v-for="(item,index) in zhigoodlist" :key="index" @click="entergood(item)">
  5 + <view class="goodlistimg">
  6 + <image :src="item.image" mode=""></image>
  7 + </view>
  8 + <view class="goodlistright">
  9 + <view class="goodrighttop flextwo">
  10 + <view class="goodname">{{item.name}}</view>
  11 + <view class="shareimg">
  12 + <image src="../static/share.png" mode="" class="sharebtn"></image>
  13 + <button open-type="share" class="shartype"></button>
  14 + </view>
  15 + </view>
  16 + <view class="zhibo flextwo">
  17 + <view class="zhiboleft" @click.stop="gozhubo(item.anchor.id)">{{item.anchor.name}}{{item.anchor.platform}}</view>
  18 + <view class="kaibo">{{item.anchor_time.time}}开播</view>
  19 + </view>
  20 + <view class="zhiboprice">
  21 + 直播价 ¥<text class="pricege">{{item.live_price}}</text>
  22 + </view>
  23 + <view class="cankao flextwo">
  24 + <view class="cankaoleft">参考价(京东¥{{item.r_price}}元)</view>
  25 + <view v-if="item.status_data==1">
  26 + <view v-if="item.user_goods==0">
  27 + <view class="canlaoright flexone" v-if="item.share==true" >
  28 + <image src="../static/naoling.png" mode="" class="naoling"></image>
  29 + 提醒我
  30 + <button open-type="share" class="sharebtnk" @click.stop="sharefriend(index,item.id,item.share)"></button>
  31 + </view>
  32 + <view class="canlaoright flexone" v-else @click.stop="tixing(index,item.id)">
  33 + <image src="../static/naoling.png" mode="" class="naoling"></image>
  34 + 提醒我
  35 + </view>
  36 +
  37 + </view>
  38 + <view class="canceltixing" v-else @click.stop="canceltixing(index,item.id)">
  39 + 取消提醒
  40 + </view>
  41 + </view>
  42 + <view v-if="item.status_data==2">
  43 + <view class="canlaoright flexone">
  44 + 已上架
  45 + </view>
  46 + </view>
  47 +
  48 + </view>
  49 + </view>
  50 + </view>
  51 + </view>
  52 + <!-- 弹出层 -->
  53 + <view class="register" v-if="noshow" @click="hideding">
  54 + <view class="registerwrap">
  55 + <view class="title">何时提醒我?</view>
  56 + <view class="titletext">在主播开始介绍商品时就提醒您</view>
  57 + <view class="title">如何提醒我</view>
  58 + <view class="titletext">在你允许消息通知后,届时会给您发送微信消息提醒</view>
  59 + <view class='noti flexone' @click.stop="notibtn">
  60 + <image src="../static/selectzhong.png" mode="" class="selectxuan" v-if="noti"></image>
  61 + <image src="../static/select.png" mode="" class="selectxuan" v-else></image>
  62 + 不再提示
  63 + </view>
  64 + <button class="buzai" @click.stop="know" v-if="share==true" open-type="share">我知道了</button>
  65 + <view class="buzai" @click.stop="know" v-else>我知道了</view>
  66 + </view>
  67 + </view>
  68 +
  69 + </view>
  70 +</template>
  71 +
  72 +<script>
  73 + import app from "../App.vue"
  74 + export default {
  75 + // noting 是否显示不再提示 1 不再显示 空是显示
  76 + props: ["zhigoodlist","notixing","dingyuenum"],
  77 + data() {
  78 + return {
  79 + goods_id: '',
  80 + noti: false, //提示和不提示按钮
  81 + noshow: false, //提示我弹出层ss
  82 + goodindex: '',
  83 + share:'',
  84 +
  85 + }
  86 + },
  87 + onLoad() {
  88 +
  89 + },
  90 + onShow() {
  91 + },
  92 + onShareAppMessage(res) {
  93 + let that = this;
  94 + if (res.from === 'button') { // 来自页面内分享按钮
  95 + console.log(res.target)
  96 + }
  97 + return {
  98 + title: '早直播',
  99 + path: '/pages/xinyuan/xinyuan'
  100 + }
  101 + },
  102 + methods: {
  103 + // 订阅消息
  104 + tixing(index, id) {
  105 + console.log(99)
  106 + let that = this;
  107 + if (uni.getStorageSync("token")) {
  108 + if (that.notixing == '') {
  109 + that.noshow = true
  110 + } else {
  111 + that.noshow = false
  112 + }
  113 + that.goodindex = index;
  114 + this.goods_id = id;
  115 + // that.dingyue()
  116 + wx.getSetting({
  117 + // withSubscriptions: true,//是否获取用户订阅消息的订阅状态,默认false不返回
  118 + success(res) {
  119 + if (res.authSetting['scope.subscribeMessage']) {
  120 + uni.openSetting({ // 打开设置页
  121 + success(res) {
  122 + console.log(res.authSetting, 88888)
  123 + }
  124 + });
  125 + } else { // 用户没有点击“总是保持以上,不再询问”则每次都会调起订阅消息
  126 + uni.requestSubscribeMessage({
  127 + tmplIds: ["XrIccvxDK3IfW3DrnLtKAtKS-pL63BrG3W0Du9l7BrU"], //
  128 + success(res) {
  129 + // 去订阅
  130 + that.dingyue()
  131 + }
  132 + })
  133 + }
  134 + }
  135 + })
  136 + } else {
  137 + uni.showToast({
  138 + title: '请先登录',
  139 + icon: 'none'
  140 + })
  141 + setTimeout(function() {
  142 + uni.switchTab({
  143 + url: '/pages/mine/mine'
  144 + })
  145 + }, 1500)
  146 + }
  147 +
  148 + },
  149 + // 取消订阅
  150 + canceltixing(index, id) {
  151 + this.goods_id = id;
  152 + this.goodindex = index;
  153 + this.dingyue()
  154 + },
  155 + // 订阅
  156 + dingyue() {
  157 + let that = this;
  158 + let url = "goods/addUserGoods";
  159 + let param = {
  160 + goods_id: that.goods_id
  161 + }
  162 + console.log('参数', param)
  163 + app.post(url, param, "post").then(r => {
  164 + console.log(r, that.goodindex, '订阅')
  165 + let newdingyuenum=that.dingyuenum;
  166 +
  167 + if (that.zhigoodlist[that.goodindex].user_goods == 0) {
  168 + that.zhigoodlist[that.goodindex].user_goods = 1;
  169 + if(newdingyuenum.indexOf(that.zhigoodlist[that.goodindex].id)==-1){
  170 + newdingyuenum.push(that.zhigoodlist[that.goodindex].id)
  171 + }
  172 +
  173 + uni.showToast({
  174 + title: '订阅成功',
  175 + icon: "none"
  176 + })
  177 +
  178 + } else {
  179 + that.zhigoodlist[that.goodindex].user_goods = 0;
  180 + newdingyuenum.forEach(function(value,index,array){
  181 + if(value==that.zhigoodlist[that.goodindex].id){
  182 + newdingyuenum.splice(index,1)
  183 + }
  184 + })
  185 +
  186 + uni.showToast({
  187 + title: '取消订阅成功',
  188 + icon: "none"
  189 + })
  190 + }
  191 + // 直播个数超过10个 显示false
  192 + that.zhigoodlist.forEach(function(value,index,array){
  193 +
  194 + if(newdingyuenum.length>=10){
  195 + if(value.user_goods ==0){
  196 + value.share=true
  197 + }
  198 + }else{
  199 + if(value.user_goods ==0){
  200 + value.share=false
  201 + }
  202 + }
  203 + })
  204 + that.zhigoodlist = that.zhigoodlist;
  205 + that.$forceUpdate();
  206 + that.$emit('tixing', that.zhigoodlist)
  207 + }).catch(err => {
  208 + console.log(err)
  209 + })
  210 + },
  211 +
  212 +
  213 + // 不再提醒
  214 + notibtn() {
  215 + this.noti = !this.noti;
  216 + if (this.noti == true) {
  217 + uni.setStorageSync("notixing", 1);
  218 + this.notixing=1
  219 + } else {
  220 + uni.setStorageSync("notixing", '');
  221 + this.notixing=''
  222 + }
  223 + },
  224 + // 我知道了
  225 + know() {
  226 + this.noshow = false
  227 + },
  228 + // 取消订阅
  229 + hideding() {
  230 + this.noshow = false
  231 + },
  232 + // 分享给好友
  233 + sharefriend(index,id,share) {
  234 + console.log(4398489)
  235 + let that = this;
  236 + if (uni.getStorageSync("token")) {
  237 + let notixing = uni.getStorageSync("notixing");
  238 + this.notixing = notixing;
  239 + if (that.notixing == '') {
  240 + that.noshow = true
  241 + } else {
  242 + that.noshow = false
  243 + }
  244 + that.goodindex = index;
  245 + that.goods_id = id;
  246 + that.share=share;
  247 + // that.dingyue()
  248 + wx.getSetting({
  249 + // withSubscriptions: true,//是否获取用户订阅消息的订阅状态,默认false不返回
  250 + success(res) {
  251 + if (res.authSetting['scope.subscribeMessage']) {
  252 + uni.openSetting({ // 打开设置页
  253 + success(res) {
  254 + console.log(res.authSetting, 88888)
  255 + }
  256 + });
  257 + } else { // 用户没有点击“总是保持以上,不再询问”则每次都会调起订阅消息
  258 + uni.requestSubscribeMessage({
  259 + tmplIds: ["XrIccvxDK3IfW3DrnLtKAtKS-pL63BrG3W0Du9l7BrU"], //
  260 + success(res) {
  261 + // 去订阅
  262 + that.dingyue()
  263 +
  264 + }
  265 + })
  266 + }
  267 + }
  268 + })
  269 + } else {
  270 + uni.showToast({
  271 + title: '请先登录',
  272 + icon: 'none'
  273 + })
  274 + setTimeout(function() {
  275 + uni.switchTab({
  276 + url: '/pages/mine/mine'
  277 + })
  278 + }, 1500)
  279 + }
  280 + },
  281 + // 进入链接页面
  282 + entergood(item){
  283 + uni.navigateTo({
  284 + url:"/pages/xinyuan/goodlianjie?code="+item.code+'&platform='+item.platform
  285 + })
  286 + },
  287 + // 进入主播页面
  288 + gozhubo(id){
  289 + uni.navigateTo({
  290 + url:'/pages/xinyuan/zhibodetail?id='+id
  291 + })
  292 + }
  293 + }
  294 +
  295 + }
  296 +</script>
  297 +
  298 +<style>
  299 + @import url("../style/goodlist");
  300 +
  301 +
  302 +</style>
  1 +<template>
  2 + <view class="container">
  3 + <view class="goodlist">
  4 + <view class="goodlistitem flex" v-for="(item,index) in listshilist" :key="index" @click="entergood(item)">
  5 + <view class="goodlistimg">
  6 + <image :src="item.image" mode=""></image>
  7 + </view>
  8 + <view class="goodlistright">
  9 + <view class="goodrighttop flextwo">
  10 + <view class="goodname">{{item.name}}</view>
  11 + <view class="shareimg">
  12 + <image src="../static/share.png" mode="" class="sharebtn"></image>
  13 + <button open-type="share" class="shartype"></button>
  14 + </view>
  15 + </view>
  16 + <view class="zhibo flextwo">
  17 + <view class="zhiboleft" @click="gozhubo(item.anchor.id)">{{item.anchor.name}}{{item.anchor.platform}}</view>
  18 + <view class="kaibo">{{item.anchor_time.time}}开播</view>
  19 + </view>
  20 + <view class="zhiboprice">
  21 + 直播价 ¥<text class="pricege">{{item.live_price}}</text>
  22 + </view>
  23 + <view class="cankao flextwo">
  24 + <view class="cankaoleft">参考价(京东¥{{item.r_price}}元)</view>
  25 + <view v-if="item.status_data==1">
  26 + <view v-if="item.user_goods==0">
  27 + <view class="canlaoright flexone" v-if="item.share==true" >
  28 + <image src="../static/naoling.png" mode="" class="naoling"></image>
  29 + 提醒我
  30 + <button open-type="share" class="sharebtnk" v-if="notixing==1" @click.stop="sharefriend(index,item.id,item.share)"></button>
  31 + </view>
  32 + <view class="canlaoright flexone" v-else @click.stop="tixing(index,item.id)">
  33 + <image src="../static/naoling.png" mode="" class="naoling"></image>
  34 + 提醒我
  35 + </view>
  36 +
  37 + </view>
  38 + <view class="canceltixing" v-else @click.stop="canceltixing(index,item.id)">
  39 + 取消提醒
  40 + </view>
  41 + </view>
  42 + <view v-if="item.status_data==2">
  43 + <view class="canlaoright flexone">
  44 + 已上架
  45 + </view>
  46 + </view>
  47 +
  48 + </view>
  49 + </view>
  50 + </view>
  51 +
  52 + </view>
  53 +
  54 + <!-- 弹出层 -->
  55 + <view class="register" v-if="noshow" @click="hideding">
  56 + <view class="registerwrap">
  57 + <view class="title">何时提醒我?</view>
  58 + <view class="titletext">在主播开始介绍商品时就提醒您</view>
  59 + <view class="title">如何提醒我</view>
  60 + <view class="titletext">在你允许消息通知后,届时会给您发送微信消息提醒</view>
  61 + <view class='noti flexone' @click="notibtn">
  62 + <image src="../static/selectzhong.png" mode="" class="selectxuan" v-if="noti"></image>
  63 + <image src="../static/select.png" mode="" class="selectxuan" v-else></image>
  64 +
  65 + 不再提示
  66 + </view>
  67 + <button class="buzai" @click.stop="know" v-if="share==true" open-type="share">我知道了</button>
  68 + <view class="buzai" @click.stop="know" v-else>我知道了</view>
  69 + </view>
  70 + </view>
  71 +
  72 + </view>
  73 +</template>
  74 +
  75 +<script>
  76 + import app from '../App.vue'
  77 +
  78 + export default {
  79 + props: ["listshilist","mine","dingyuenumk"],
  80 + data() {
  81 + return {
  82 + goods_id: '',
  83 + noti: false, //提示和不提示按钮
  84 + noshow: false, //提示我弹出层
  85 + notixing: '', //不再提醒判断
  86 + goodindex: ''
  87 + }
  88 + },
  89 + onShareAppMessage(res) {
  90 + let that = this;
  91 + if (res.from === 'button') { // 来自页面内分享按钮
  92 + console.log(res.target)
  93 + }
  94 + return {
  95 + title: '早直播',
  96 + path: '/pages/xinyuan/xinyuan'
  97 + }
  98 + },
  99 + onLoad() {
  100 +
  101 +
  102 +
  103 + },
  104 + methods: {
  105 + // 订阅消息
  106 + tixing(index, id) {
  107 + let that = this;
  108 + let notixing = uni.getStorageSync("notixing");
  109 + this.notixing = notixing;
  110 + console.log(that.notixing)
  111 + if (that.notixing == '') {
  112 + that.noshow = true
  113 + } else {
  114 + that.noshow = false
  115 + }
  116 + that.goodindex = index;
  117 + this.goods_id = id;
  118 + wx.getSetting({
  119 + // withSubscriptions: true,//是否获取用户订阅消息的订阅状态,默认false不返回
  120 + success(res) {
  121 + if (res.authSetting['scope.subscribeMessage']) {
  122 + uni.openSetting({ // 打开设置页
  123 + success(res) {
  124 + console.log(res.authSetting, 88888)
  125 + }
  126 + });
  127 + } else { // 用户没有点击“总是保持以上,不再询问”则每次都会调起订阅消息
  128 + uni.requestSubscribeMessage({
  129 + tmplIds: ["XrIccvxDK3IfW3DrnLtKAtKS-pL63BrG3W0Du9l7BrU"], //
  130 + success(res) {
  131 + console.log(res, 99999)
  132 + that.dingyue()
  133 +
  134 + }
  135 + })
  136 + }
  137 + }
  138 + })
  139 + },
  140 + // 取消订阅
  141 + canceltixing(index, id) {
  142 + this.goods_id = id;
  143 + this.goodindex = index;
  144 + this.dingyue()
  145 + },
  146 +
  147 +
  148 + // 订阅
  149 + dingyue() {
  150 + let that = this;
  151 + let url = "goods/addUserGoods";
  152 + let param = {
  153 + goods_id: that.goods_id
  154 + }
  155 + console.log('参数', param)
  156 + app.post(url, param, "post").then(r => {
  157 + let newdingyuenumk=that.dingyuenumk;
  158 +
  159 + if (that.listshilist[that.goodindex].user_goods == 0) {
  160 + that.listshilist[that.goodindex].user_goods = 1;
  161 + if(newdingyuenumk.indexOf(that.zhigoodlist[that.goodindex].id)==-1){
  162 + newdingyuenumk.push(that.zhigoodlist[that.goodindex].id)
  163 + }
  164 + uni.showToast({
  165 + title: '订阅成功',
  166 + icon: "none"
  167 + })
  168 +
  169 + } else {
  170 + that.listshilist[that.goodindex].user_goods = 0;
  171 + newdingyuenumk.forEach(function(value,index,array){
  172 + if(value==that.zhigoodlist[that.goodindex].id){
  173 + newdingyuenumk.splice(index,1)
  174 + }
  175 + })
  176 + uni.showToast({
  177 + title: '取消订阅成功',
  178 + icon: "none"
  179 + })
  180 + }
  181 + // 直播个数超过10个 显示false
  182 + that.zhigoodlist.forEach(function(value,index,array){
  183 + if(newdingyuenumk.length>=10){
  184 + if(value.user_goods ==0){
  185 + value.share=true
  186 + }
  187 + }else{
  188 + if(value.user_goods ==0){
  189 + value.share=false
  190 + }
  191 + }
  192 + })
  193 + if(that.mine==1){
  194 + let newlistshilist=that.listshilist;
  195 + newlistshilist.splice(that.goodindex,1)
  196 + that.listshilist = newlistshilist;
  197 + }else{
  198 + that.listshilist = that.listshilist;
  199 + }
  200 +
  201 + console.log(that.listshilist)
  202 + that.$forceUpdate();
  203 + that.$emit('litixing', that.listshilist)
  204 +
  205 +
  206 + }).catch(err => {
  207 + console.log(err)
  208 + })
  209 + },
  210 + // 不再提醒
  211 + notibtn() {
  212 + this.noti = !this.noti;
  213 + if (this.noti == true) {
  214 + uni.setStorageSync("notixing", 1);
  215 + this.notixing=1
  216 + } else {
  217 + uni.setStorageSync("notixing", '');
  218 + this.notixing=''
  219 + }
  220 + },
  221 + // 我知道了
  222 + know() {
  223 + this.noshow = false
  224 + },
  225 + // 取消订阅
  226 + hideding() {
  227 + this.noshow = false
  228 + },
  229 + // 分享给好友
  230 + sharefriend(index,id,share) {
  231 + let that = this;
  232 + if (uni.getStorageSync("token")) {
  233 + let notixing = uni.getStorageSync("notixing");
  234 + this.notixing = notixing;
  235 + if (that.notixing == '') {
  236 + that.noshow = true
  237 + } else {
  238 + that.noshow = false
  239 + }
  240 + that.goodindex = index;
  241 + that.goods_id = id;
  242 + that.share=share;
  243 + wx.getSetting({
  244 + // withSubscriptions: true,//是否获取用户订阅消息的订阅状态,默认false不返回
  245 + success(res) {
  246 + if (res.authSetting['scope.subscribeMessage']) {
  247 + uni.openSetting({ // 打开设置页
  248 + success(res) {
  249 + console.log(res.authSetting, 88888)
  250 + }
  251 + });
  252 + } else { // 用户没有点击“总是保持以上,不再询问”则每次都会调起订阅消息
  253 + uni.requestSubscribeMessage({
  254 + tmplIds: ["XrIccvxDK3IfW3DrnLtKAtKS-pL63BrG3W0Du9l7BrU"], //
  255 + success(res) {
  256 + // 去订阅
  257 + that.dingyue()
  258 +
  259 + }
  260 + })
  261 + }
  262 + }
  263 + })
  264 + } else {
  265 + uni.showToast({
  266 + title: '请先登录',
  267 + icon: 'none'
  268 + })
  269 + setTimeout(function() {
  270 + uni.switchTab({
  271 + url: '/pages/mine/mine'
  272 + })
  273 + }, 1500)
  274 + }
  275 + },
  276 + // 进入链接页面
  277 + entergood(item){
  278 + uni.navigateTo({
  279 + url:"/pages/xinyuan/goodlianjie?code="+item.code+'&platform='+item.platform
  280 + })
  281 + },
  282 + // 进入主播页面
  283 + gozhubo(id){
  284 + uni.navigateTo({
  285 + url:'/pages/xinyuan/zhibodetail?id='+id
  286 + })
  287 + }
  288 +
  289 + }
  290 +
  291 + }
  292 +</script>
  293 +
  294 +<style>
  295 + @import url("../style/goodlist");
  296 +</style>
  1 +<template>
  2 + <view class="container">
  3 + <view class="goodlist">
  4 + <view class="goodlistitem flex" v-for="(item,index) in listshilist" :key="index" @cilck="entergood(item)">
  5 + <view class="goodlistimg">
  6 + <image :src="item.image" mode=""></image>
  7 + </view>
  8 + <view class="goodlistright">
  9 + <view class="goodrighttop flextwo">
  10 + <view class="goodname">{{item.name}}</view>
  11 + <view class="shareimg">
  12 + <image src="../static/share.png" mode="" class="sharebtn"></image>
  13 + </view>
  14 + </view>
  15 + <view class="zhibo flextwo">
  16 + <view class="zhiboleft">{{item.anchor.name}}{{item.anchor.platform}}</view>
  17 + <view class="kaibo">{{item.anchor_time.time}}开播</view>
  18 + </view>
  19 + <view class="zhiboprice">
  20 + 直播价 ¥<text class="pricege">{{item.live_price}}</text>送同款234ml
  21 + </view>
  22 + <view class="cankao flextwo">
  23 + <view class="cankaoleft">参考价(京东¥{{item.r_price}}元)</view>
  24 +
  25 + <view class="canceltixing" @click.stop="cancelti(index,item.id)">
  26 + 取消提醒
  27 + </view>
  28 +
  29 + </view>
  30 + </view>
  31 + </view>
  32 +
  33 + </view>
  34 + </view>
  35 +</template>
  36 +
  37 +<script>
  38 + import app from "../App.vue"
  39 +
  40 + export default {
  41 + props: ["listshilist"],
  42 + data() {
  43 + return {
  44 +
  45 + }
  46 + },
  47 + onLoad() {
  48 +
  49 +
  50 +
  51 + },
  52 + methods: {
  53 + // 取消提醒
  54 + cancelti(index,id){
  55 + let that = this;
  56 + var url = "goods/addUserGoods"
  57 + var param={
  58 + goods_id:id
  59 + }
  60 + app.post(url, param, "post").then(res => {
  61 + console.log('取消订阅', res)
  62 + uni.showToast({
  63 + title:"取消订阅成功",
  64 + icon:"none"
  65 + })
  66 + console.log(index)
  67 + let newlishsilist=that.listshilist;
  68 + newlishsilist.splice(index,1)
  69 + that.listshilist=newlishsilist;
  70 + that.$forceUpdate()
  71 + that.$emit('tixing', that.listshilist)
  72 +
  73 + }).catch(err => {
  74 + console.log(err)
  75 + })
  76 + },
  77 + // 进入链接页面
  78 + entergood(item){
  79 + uni.navigateTo({
  80 + url:"/pages/xinyuan/goodlianjie?code="+item.code
  81 + })
  82 + }
  83 +
  84 + }
  85 +
  86 + }
  87 +</script>
  88 +
  89 +<style>
  90 + @import url("../style/goodlist");
  91 +</style>
  1 +import Vue from 'vue'
  2 +import App from './App'
  3 +
  4 +Vue.config.productionTip = false
  5 +
  6 +App.mpType = 'app'
  7 +
  8 +const app = new Vue({
  9 + ...App
  10 +})
  11 +app.$mount()
  1 +{
  2 + "name" : "zhiboproject",
  3 + "appid" : "__UNI__700DE61",
  4 + "description" : "",
  5 + "versionName" : "1.0.0",
  6 + "versionCode" : "100",
  7 + "transformPx" : false,
  8 + /* 5+App特有相关 */
  9 + "app-plus" : {
  10 + "usingComponents" : true,
  11 + "nvueCompiler" : "uni-app",
  12 + "compilerVersion" : 3,
  13 + "splashscreen" : {
  14 + "alwaysShowBeforeRender" : true,
  15 + "waiting" : true,
  16 + "autoclose" : true,
  17 + "delay" : 0
  18 + },
  19 + /* 模块配置 */
  20 + "modules" : {},
  21 + /* 应用发布信息 */
  22 + "distribute" : {
  23 + /* android打包配置 */
  24 + "android" : {
  25 + "permissions" : [
  26 + "<uses-permission android:name=\"android.permission.CHANGE_NETWORK_STATE\"/>",
  27 + "<uses-permission android:name=\"android.permission.MOUNT_UNMOUNT_FILESYSTEMS\"/>",
  28 + "<uses-permission android:name=\"android.permission.READ_CONTACTS\"/>",
  29 + "<uses-permission android:name=\"android.permission.VIBRATE\"/>",
  30 + "<uses-permission android:name=\"android.permission.READ_LOGS\"/>",
  31 + "<uses-permission android:name=\"android.permission.ACCESS_WIFI_STATE\"/>",
  32 + "<uses-feature android:name=\"android.hardware.camera.autofocus\"/>",
  33 + "<uses-permission android:name=\"android.permission.WRITE_CONTACTS\"/>",
  34 + "<uses-permission android:name=\"android.permission.ACCESS_NETWORK_STATE\"/>",
  35 + "<uses-permission android:name=\"android.permission.CAMERA\"/>",
  36 + "<uses-permission android:name=\"android.permission.RECORD_AUDIO\"/>",
  37 + "<uses-permission android:name=\"android.permission.GET_ACCOUNTS\"/>",
  38 + "<uses-permission android:name=\"android.permission.MODIFY_AUDIO_SETTINGS\"/>",
  39 + "<uses-permission android:name=\"android.permission.READ_PHONE_STATE\"/>",
  40 + "<uses-permission android:name=\"android.permission.CHANGE_WIFI_STATE\"/>",
  41 + "<uses-permission android:name=\"android.permission.WAKE_LOCK\"/>",
  42 + "<uses-permission android:name=\"android.permission.CALL_PHONE\"/>",
  43 + "<uses-permission android:name=\"android.permission.FLASHLIGHT\"/>",
  44 + "<uses-permission android:name=\"android.permission.ACCESS_COARSE_LOCATION\"/>",
  45 + "<uses-feature android:name=\"android.hardware.camera\"/>",
  46 + "<uses-permission android:name=\"android.permission.ACCESS_FINE_LOCATION\"/>",
  47 + "<uses-permission android:name=\"android.permission.WRITE_SETTINGS\"/>"
  48 + ]
  49 + },
  50 + /* ios打包配置 */
  51 + "ios" : {},
  52 + /* SDK配置 */
  53 + "sdkConfigs" : {}
  54 + }
  55 + },
  56 + /* 快应用特有相关 */
  57 + "quickapp" : {},
  58 + /* 小程序特有相关 */
  59 + "mp-weixin" : {
  60 + "appid" : "wx7c6f9b9dbc7a7d94",
  61 + "setting" : {
  62 + "urlCheck" : false,
  63 + "postcss" : true
  64 + },
  65 + "usingComponents" : true
  66 + },
  67 + "mp-alipay" : {
  68 + "usingComponents" : true
  69 + },
  70 + "mp-baidu" : {
  71 + "usingComponents" : true
  72 + },
  73 + "mp-toutiao" : {
  74 + "usingComponents" : true
  75 + },
  76 + "uniStatistics" : {
  77 + "enable" : false
  78 + }
  79 +}
  1 +{
  2 + "pages": [ //pages数组中第一项表示应用启动页,参考:https://uniapp.dcloud.io/collocation/pages
  3 + {
  4 + "path": "pages/xinyuan/xinyuan",
  5 + "style": {
  6 + "navigationBarTitleText": "心愿商品",
  7 + "navigationBarBackgroundColor": "#FFFFFF",
  8 + "navigationBarTextStyle": "black"
  9 + }
  10 + },
  11 +
  12 + {
  13 + "path": "pages/mine/mine",
  14 + "style": {
  15 + "navigationBarTitleText": "我的提醒",
  16 + "navigationBarBackgroundColor": "#FFFFFF",
  17 + "navigationBarTextStyle": "black"
  18 + }
  19 + },
  20 + {
  21 + "path": "pages/xinyuan/zhibodetail",
  22 + "style": {
  23 + "navigationBarTitleText": "主播详情",
  24 + "navigationBarBackgroundColor": "#FFFFFF",
  25 + "navigationBarTextStyle": "black"
  26 + }
  27 + },
  28 + {
  29 + "path": "pages/xinyuan/zhidetail",
  30 + "style": {
  31 + "navigationBarTitleText": "直播详情",
  32 + "navigationBarBackgroundColor": "#FFFFFF",
  33 + "navigationBarTextStyle": "black"
  34 + }
  35 + },
  36 + {
  37 + "path": "pages/zhubo/zhubo",
  38 + "style": {
  39 + "navigationBarTitleText": "主播列表",
  40 + "navigationBarBackgroundColor": "#FFFFFF",
  41 + "navigationBarTextStyle": "black"
  42 + }
  43 + },
  44 +
  45 + {
  46 + "path": "pages/xinyuan/search",
  47 + "style": {
  48 + "navigationBarTitleText": "搜索",
  49 + "navigationBarBackgroundColor": "#FFFFFF",
  50 + "navigationBarTextStyle": "black"
  51 + }
  52 + },
  53 + {
  54 + "path": "pages/xinyuan/sanjikind",
  55 + "style": {
  56 + "navigationBarTitleText": "直播早知道",
  57 + "navigationBarBackgroundColor": "#FFFFFF",
  58 + "navigationBarTextStyle": "black"
  59 + }
  60 + },
  61 + {
  62 + "path": "pages/xinyuan/erjikind",
  63 + "style": {
  64 + "navigationBarTitleText": "直播早知道",
  65 + "navigationBarBackgroundColor": "#FFFFFF",
  66 + "navigationBarTextStyle": "black"
  67 + }
  68 + },
  69 +
  70 + {
  71 + "path": "pages/xinyuan/goodlianjie",
  72 + "style": {
  73 + "navigationBarTitleText": "商品链接",
  74 + "navigationBarBackgroundColor": "#FFFFFF",
  75 + "navigationBarTextStyle": "black"
  76 + }
  77 + },
  78 + {
  79 + "path": "pages/xinyuan/zhiboknow",
  80 + "style": {
  81 + "navigationBarTitleText": "直播早知道",
  82 + "navigationBarBackgroundColor": "#FFFFFF",
  83 + "navigationBarTextStyle": "black"
  84 + }
  85 + },
  86 +
  87 + {
  88 + "path": "pages/index/index",
  89 + "style": {
  90 + "navigationBarTitleText": "uni-app"
  91 + }
  92 + }
  93 +
  94 + ],
  95 + "tabBar": {
  96 + "color": "#8C9299",
  97 + "selectedColor": "#FF5D8E",
  98 + "borderStyle": "black",
  99 + "backgroundColor": "#ffffff",
  100 + "list": [{
  101 + "pagePath": "pages/xinyuan/xinyuan",
  102 + "iconPath": "static/xinyuan.png",
  103 + "selectedIconPath": "static/xinyuanactive.png",
  104 + "text": "心愿商品"
  105 +
  106 + }, {
  107 + "pagePath": "pages/zhubo/zhubo",
  108 + "iconPath": "static/zhibo.png",
  109 + "selectedIconPath": "static/zhiboactive.png",
  110 + "text": "主播列表"
  111 + },
  112 + {
  113 + "pagePath": "pages/mine/mine",
  114 + "iconPath": "./static/mine.png",
  115 + "selectedIconPath": "static/mineactive.png",
  116 + "text": "我的"
  117 + }
  118 +
  119 +
  120 + ]
  121 + },
  122 + "globalStyle": {
  123 + "navigationBarTextStyle": "black",
  124 + "navigationBarTitleText": "uni-app",
  125 + "navigationBarBackgroundColor": "#F8F8F8",
  126 + "backgroundColor": "#F8F8F8"
  127 + }
  128 +}
  1 +<template>
  2 + <view class="content">
  3 + <image class="logo" src="/static/logo.png"></image>
  4 + <view class="text-area">
  5 + <text class="title">{{title}}</text>
  6 + </view>
  7 + </view>
  8 +</template>
  9 +
  10 +<script>
  11 + export default {
  12 + data() {
  13 + return {
  14 + title: 'Hello'
  15 + }
  16 + },
  17 + onLoad() {
  18 +
  19 + },
  20 + methods: {
  21 +
  22 + }
  23 + }
  24 +</script>
  25 +
  26 +<style>
  27 + .content {
  28 + display: flex;
  29 + flex-direction: column;
  30 + align-items: center;
  31 + justify-content: center;
  32 + }
  33 +
  34 + .logo {
  35 + height: 200rpx;
  36 + width: 200rpx;
  37 + margin-top: 200rpx;
  38 + margin-left: auto;
  39 + margin-right: auto;
  40 + margin-bottom: 50rpx;
  41 + }
  42 +
  43 + .text-area {
  44 + display: flex;
  45 + justify-content: center;
  46 + }
  47 +
  48 + .title {
  49 + font-size: 36rpx;
  50 + color: #8f8f94;
  51 + }
  52 +</style>
  1 +<template>
  2 + <view class="container">
  3 + <view class="minetop flexone">
  4 + <view class="minetopleft">
  5 + <image src="../../static/zhuboimg.png" mode="" v-if="userinfo==''"></image>
  6 + <image :src="userinfo.avatar" mode="" v-else></image>
  7 + </view>
  8 + <button class="minename" open-type="getUserInfo" @getuserinfo="wxGetUserInfo" v-if="userinfo==''">请先登录</button>
  9 + <view class="minename" v-else>{{userinfo.nickname}}</view>
  10 + </view>
  11 + <view class="tixinglist flextwo">
  12 + <view class="tixinglistitem" @click="tabclick(1)">
  13 + <image src="../../static/kaishou.png" mode="" class="kaiimg"></image>
  14 + <view class='kainame'>即将开售</view>
  15 + </view>
  16 + <view class="tixinglistitem" @click="tabclick(2)">
  17 + <image src="../../static/jitixing.png" mode="" class="kaiimg"></image>
  18 + <view class='kainame'>累计提醒</view>
  19 + </view>
  20 + <view class="tixinglistitem" @click="tabclick(3)">
  21 + <image src="../../static/guanzhu.png" mode="" class="kaiimg"></image>
  22 + <view class='kainame'>关注主播</view>
  23 + </view>
  24 + <view class="tixinglistitem" @click="tabclick(4)">
  25 + <image src="../../static/xinyuandan.png" mode="" class="kaiimg"></image>
  26 + <view class='kainame'>心愿商品</view>
  27 + </view>
  28 + </view>
  29 + <view class="nodata" v-if="listshilist.length==0">暂无数据</view>
  30 + <view v-else>
  31 + <!-- 即将开售 -->
  32 + <view class="kaishoulist" v-if="showclick==1">
  33 + <view class="want flextwo">
  34 + <view class="wantleft flexone">
  35 + <image src="../../static/jikaishou.png" mode="" class="likeimg"></image>
  36 + 即将开售
  37 + </view>
  38 + </view>
  39 + <goodlistone :listshilist="listshilist" :mine="1" @litixing="litixing" ></goodlistone>
  40 + </view>
  41 + <!-- 累计提醒 -->
  42 + <view class="kaishoulist" v-if="showclick==2">
  43 + <view class="want flextwo">
  44 + <view class="wantleft flexone">
  45 + <image src="../../static/jikaishou.png" mode="" class="likeimg"></image>
  46 + 累计提醒
  47 + </view>
  48 + </view>
  49 + <leiji :listshilist="listshilist" @tixing="tixing"></leiji>
  50 + </view>
  51 + <!-- 关注主播 -->
  52 + <view class="leiji" v-if="showclick==3">
  53 + <view class="want flextwo">
  54 + <view class="wantleft flexone">
  55 + <image src="../../static/guaznhuzhu.png" mode="" class="likeimg"></image>
  56 + 关注主播
  57 + </view>
  58 + </view>
  59 + <view class='leijiitem flextwo' v-for="(item,index) in listshilist" :key="index">
  60 + <view class="leijiitemleft flexone">
  61 + <image :src="item.avatar" mode="" class="leijiimg"></image>
  62 + <view class="lejibox">
  63 + <view class="lejiname">{{item.name}}</view>
  64 + <view class='lejiatten' v-if="item.anchor_time!=null">{{item.anchor_time.title}}</view>
  65 + </view>
  66 + </view>
  67 + <view class="canceldingyuebtn" @click="cancelzhu(index,item.id)">取消订阅</view>
  68 + </view>
  69 + </view>
  70 + <!-- 心愿品类 -->
  71 + <view class="leiji" v-if="showclick==4">
  72 + <view class="want flextwo">
  73 + <view class="wantleft flexone">
  74 + <image src="../../static/xinyuangood.png" mode="" class="likeimg"></image>
  75 + 心愿品类
  76 + </view>
  77 + </view>
  78 + <view class='leijiitem flextwo' v-for="(item,index) in listshilist" :key="index">
  79 + <view class="leijiitemleft flexone">
  80 + <image :src="item.image" mode="" class="leijiimg"></image>
  81 + <view class="lejibox">
  82 + <view class="lejiname">{{item.name}}</view>
  83 + </view>
  84 + </view>
  85 + <view class="canceldingyuebtn" @click="cancelxin(index,item.id)">取消订阅</view>
  86 + </view>
  87 + </view>
  88 +
  89 + </view>
  90 + </view>
  91 +</template>
  92 +
  93 +<script>
  94 + import app from "../../App.vue";
  95 + import goodlistone from "../../compontent/goodlistone.vue"
  96 + import leiji from "../../compontent/leiji.vue"
  97 + export default {
  98 + components: {
  99 + goodlistone,
  100 + leiji
  101 + },
  102 + data() {
  103 + return {
  104 + showclick: 1,
  105 + openid: "",
  106 + session_key: '',
  107 + encrypted_data: '',
  108 + iv: "",
  109 + userinfo: '', //用户信息
  110 + page: 1,
  111 + listshilist: [],
  112 + showpull: true,
  113 + dingyuenumk:[]
  114 + }
  115 + },
  116 + onLoad() {},
  117 + onShow() {
  118 + this.get_sessionkey();
  119 + if (uni.getStorageSync("token")) {
  120 + this.getuserinfo()
  121 + }
  122 + this.listshilist = [];
  123 + this.dingyuenumk=[]
  124 + this.page = 1;
  125 + this.getkaishou()
  126 + },
  127 + onReachBottom() {
  128 + that = this
  129 + let newpage = that.page;
  130 + newpage++
  131 + that.page = newpage;
  132 + if (that.showpull == true) {
  133 + console.log(38493409)
  134 + Toast('没有更多了~')
  135 + } else {
  136 + if (that.showclick == 1 || that.showclick == 2) {
  137 + that.getkaishou()
  138 + }
  139 +
  140 + }
  141 + },
  142 + methods: {
  143 + //子元素传来的值
  144 + tixing(e) {
  145 + this.listshilist = e
  146 + },
  147 + litixing(e){
  148 + console.log(e)
  149 + this.listshilist = e
  150 + },
  151 + // 获取即将开售和累计提醒
  152 + getkaishou() {
  153 + let that = this;
  154 + let url = "user/getUserGoods";
  155 + let param = {
  156 + type: that.showclick,
  157 + page: that.page,
  158 + per_page: 20
  159 + }
  160 + console.log('参数', param)
  161 + app.post(url, param, "post").then(r => {
  162 + console.log('即将开售', r)
  163 + that.listshilist = that.listshilist.concat(r.data);
  164 + if (that.page > 1) {
  165 + if (r.data.length == 0) {
  166 + that.showpull = false
  167 + }
  168 + }
  169 + that.listshilist.forEach(function(value,index,array){
  170 + if(value.user_goods==1){
  171 + if(that.dingyuenumk.indexOf(value.id)==-1){
  172 + that.dingyuenumk.push(value.id);
  173 + that.dingyuenumk=that.dingyuenumk
  174 + }
  175 + }
  176 + })
  177 + that.listshilist = that.listshilist;
  178 + that.$forceUpdate();
  179 + console.log(that.listshilist)
  180 +
  181 + }).catch(err => {
  182 + console.log(err)
  183 + })
  184 + },
  185 + // 获取主播列表
  186 + getzhubolist() {
  187 + let that = this;
  188 + let url = "user/getAnchor";
  189 + let param = {
  190 +
  191 + page: that.page,
  192 + per_page: 20
  193 + }
  194 + console.log('参数', param)
  195 + app.post(url, param, "post").then(r => {
  196 + console.log('主播列表', r)
  197 + that.listshilist = that.listshilist.concat(r.data);
  198 + if (that.page > 1) {
  199 + if (r.data.length == 0) {
  200 + that.showpull = false
  201 + }
  202 + }
  203 +
  204 +
  205 + }).catch(err => {
  206 + console.log(err)
  207 + })
  208 + },
  209 + // 心愿商品
  210 + getxinyuan() {
  211 + let that = this;
  212 + let url = "user/getCategory";
  213 + let param = {
  214 +
  215 + page: that.page,
  216 + per_page: 20
  217 + }
  218 + console.log('参数', param)
  219 + app.post(url, param, "post").then(r => {
  220 + console.log('心愿商品', r)
  221 + that.listshilist = that.listshilist.concat(r.data);
  222 + if (that.page > 1) {
  223 + if (r.data.length == 0) {
  224 + that.showpull = false
  225 + }
  226 + }
  227 +
  228 + }).catch(err => {
  229 + console.log(err)
  230 + })
  231 + },
  232 + // 取消订阅主播
  233 + cancelzhu(index, id) {
  234 + let that = this;
  235 + var url = "anchor/addUserAnchor"
  236 + var param = {
  237 + anchor_id: id
  238 + }
  239 + app.post(url, param, "post").then(res => {
  240 + console.log('取消订阅', res)
  241 + uni.showToast({
  242 + title: "取消订阅成功",
  243 + icon: "none"
  244 + })
  245 + console.log(index)
  246 + let newlishsilist = that.listshilist;
  247 + newlishsilist.splice(index, 1)
  248 + that.listshilist = newlishsilist;
  249 + that.$forceUpdate()
  250 +
  251 +
  252 + }).catch(err => {
  253 + console.log(err)
  254 + })
  255 + },
  256 + // 取消心愿商品
  257 + cancelxin(index,id){
  258 + let that = this;
  259 + var url = "category/addUserCate"
  260 + var param = {
  261 + cate_id: id
  262 + }
  263 + app.post(url, param, "post").then(res => {
  264 + console.log('取消订阅', res)
  265 + uni.showToast({
  266 + title: "取消订阅成功",
  267 + icon: "none"
  268 + })
  269 + console.log(index)
  270 + let newlishsilist = that.listshilist;
  271 + newlishsilist.splice(index, 1)
  272 + that.listshilist = newlishsilist;
  273 + that.$forceUpdate()
  274 +
  275 +
  276 + }).catch(err => {
  277 + console.log(err)
  278 + })
  279 + },
  280 + tabclick(id) {
  281 + this.showclick = id;
  282 + this.page = 1;
  283 + this.listshilist = [];
  284 + this.dingyuenumk=[]
  285 + if (this.showclick == 1 || this.showclick == 2) {
  286 + this.getkaishou()
  287 + } else if (this.showclick == 3) {
  288 + if (uni.getStorageSync("token")) {
  289 + this.getzhubolist()
  290 + }
  291 + } else if (this.showclick == 4) {
  292 + this.getxinyuan()
  293 + }
  294 +
  295 +
  296 + },
  297 +
  298 + get_sessionkey() {
  299 + let that = this;
  300 + uni.login({
  301 + provider: "weixin",
  302 + success(r) {
  303 + console.log(r)
  304 + let url = "wechat/getSessionKey";
  305 + app.post(url, {
  306 + code: r.code
  307 + }, "post").then(r => {
  308 + console.log(r)
  309 + that.session_key = r.session_key;
  310 + that.openid = r.openid;
  311 +
  312 + }).catch(err => {})
  313 +
  314 + }
  315 + })
  316 +
  317 +
  318 + },
  319 + // 微信登录
  320 + wxGetUserInfo(e) {
  321 + console.log(e)
  322 + this.encrypted_data = e.detail.encryptedData
  323 + this.iv = e.detail.iv
  324 + this.login()
  325 + },
  326 + login() {
  327 + let that = this;
  328 + console.log('34898498')
  329 + uni.login({
  330 + provider: "weixin",
  331 + success(r) {
  332 + console.log(r, 6666)
  333 + let url = "wechat/login";
  334 + let param = {
  335 + openid: that.openid,
  336 + session_key: that.session_key,
  337 + encrypted_data: that.encrypted_data,
  338 + iv: that.iv,
  339 +
  340 + }
  341 + console.log('参数', param)
  342 + app.post(url, param, "post").then(r => {
  343 + console.log('登陆成功', r);
  344 +
  345 + uni.setStorageSync("token", r.token)
  346 + that.getuserinfo()
  347 +
  348 + // that.getuserinfo()
  349 +
  350 + // uni.setStorageSync('openid', r.openid);
  351 + // uni.setStorageSync('session_key', r.session_key);
  352 + }).catch(err => {
  353 + console.log(err)
  354 + })
  355 +
  356 + }
  357 + })
  358 + },
  359 + // 获取用户信息
  360 + getuserinfo() {
  361 + let that = this;
  362 + let url = "user/getUserInfo";
  363 + let param = {
  364 +
  365 + }
  366 + console.log('参数', param)
  367 + app.post(url, param, "post").then(r => {
  368 + console.log('用户信息', r)
  369 + that.userinfo = r
  370 +
  371 +
  372 + // that.getuserinfo()
  373 +
  374 + // uni.setStorageSync('openid', r.openid);
  375 + // uni.setStorageSync('session_key', r.session_key);
  376 + }).catch(err => {
  377 + console.log(err)
  378 + })
  379 + }
  380 +
  381 + }
  382 +
  383 + }
  384 +</script>
  385 +
  386 +<style>
  387 + @import url("../../style/xinyuan");
  388 +
  389 + page {
  390 + background: #f5f5f5;
  391 + }
  392 +
  393 + .want {
  394 + margin-top: 0
  395 + }
  396 +
  397 + button {
  398 + margin: 0px;
  399 + padding: 0px;
  400 + /*自定义边框*/
  401 + border: none;
  402 + /*消除默认点击蓝色边框效果*/
  403 + outline: none;
  404 + background: transparent;
  405 +
  406 + }
  407 +
  408 + button::after {
  409 + border: none;
  410 + outline: none;
  411 + background: transparent;
  412 +
  413 + }
  414 +
  415 + button:focus {
  416 + border: 0 none;
  417 + outline: none;
  418 + background: transparent;
  419 + box-shadow: none;
  420 + }
  421 +
  422 + button:active {
  423 + border: 0 none;
  424 + outline: none;
  425 + background: transparent;
  426 + box-shadow: none;
  427 + }
  428 +
  429 + .register {
  430 + width: 100%;
  431 + height: 100%;
  432 + background-color: rgba(0, 0, 0, 0.5);
  433 + position: fixed;
  434 + top: 0;
  435 + left: 0;
  436 + right: 0;
  437 + z-index: 5;
  438 + }
  439 +</style>
  1 +<template>
  2 + <view class="container">
  3 + <view class="want flextwo">
  4 + <view class="wantleft flexone">
  5 + 热门品类推荐
  6 + </view>
  7 + </view>
  8 + <goodkind :wantlist="wantlist"></goodkind>
  9 + <view class="want flextwo">
  10 + <view class="wantleft flexone">
  11 + <image src="../../static/meizhuang.png" mode="" class="likeimg"></image>
  12 + 近期美妆直播
  13 + </view>
  14 + </view>
  15 + <goodlist :zhigoodlist="zhigoodlist" :dingyuenum="dingyuenum" :nothing="notixing"></goodlist>
  16 + <!-- 这里也有你想要的 -->
  17 + <view class="want flextwo">
  18 + <view class="wantleft flexone">
  19 + <image src="../../static/like.png" mode="" class="likeimg"></image>
  20 + 也许这里也又你想要的
  21 + </view>
  22 + <view class="more flexone" @click="more">
  23 + 更多
  24 + <img src="../../static/yourow.png" alt="" class="yourow">
  25 + </view>
  26 + </view>
  27 + <goodkindone :wantlistone="wantlistone"></goodkindone>
  28 +
  29 + </view>
  30 +</template>
  31 +<script>
  32 + import app from "../../App.vue";
  33 + import goodkind from "../../compontent/goodkind.vue"
  34 + import goodkindone from "../../compontent/goodkindone.vue"
  35 + import goodlist from "../../compontent/goodlist.vue"
  36 +
  37 + export default {
  38 + components: {
  39 + goodkind,
  40 + goodlist,
  41 + goodkindone,
  42 +
  43 +
  44 + },
  45 + data() {
  46 + return {
  47 + search: false,
  48 + havesou: true,
  49 + goodshow:false,
  50 + wantlist:[],
  51 + showpull:true,
  52 + cate_one_id:'',//一级分类id
  53 + cate_two_id:'',//二级id
  54 + zhigoodlist:[],
  55 + wantlistone:[],
  56 + dingyuenum:[],
  57 + notixing:''
  58 +
  59 + }
  60 + },
  61 + onLoad(options) {
  62 + if(options.type==1){
  63 + this.cate_one_id=options.id;
  64 + }else{
  65 + this.cate_two_id=options.id;
  66 + }
  67 + let notixing = uni.getStorageSync("notixing");
  68 + this.notixing = notixing;
  69 +
  70 + // 近期美妆直播
  71 + this.getnearlist()
  72 + // 获取热门品类
  73 + this.gethotkind();
  74 + // 这里有你想要的
  75 + this.getwant()
  76 + },
  77 + onReachBottom() {
  78 + that=this
  79 + let newpage=that.page;
  80 + newpage++
  81 + that.page=newpage;
  82 + if(that.showpull==true){
  83 + console.log(38493409)
  84 + Toast('没有更多了~')
  85 + }else{
  86 + that.getnearlist()
  87 + }
  88 + },
  89 + methods: {
  90 + // 获取热门分类
  91 + gethotkind(){
  92 + let that = this;
  93 + var url = "category/getRandCategory"
  94 + var param={
  95 + cate_one_id:that.cate_one_id,
  96 + type:2
  97 + }
  98 + app.post(url, param, "post").then(res => {
  99 + console.log('三级分类', res)
  100 + that.wantlist=res;
  101 +
  102 +
  103 + }).catch(err => {
  104 + console.log(err)
  105 + })
  106 + },
  107 + // 近期美妆直播
  108 + getnearlist(){
  109 + let that = this;
  110 + var url = "goods/getAnchorTimeGoods"
  111 + var param={
  112 + cate_one_id:that.cate_one_id,
  113 + cate_two_id:that.cate_two_id,
  114 + type:1
  115 + }
  116 + app.post(url, param, "post").then(res => {
  117 + console.log('商品列表', res)
  118 + that.zhigoodlist=that.zhigoodlist.concat(res.data);
  119 + if(that.page>1){
  120 + if(res.data.lenth==0){
  121 + that.showpull=false
  122 + }
  123 + }
  124 + console.log(that.zhigoodlist)
  125 + that.zhigoodlist.forEach(function(value,index,array){
  126 + if(value.user_goods==1){
  127 + if(that.dingyuenum.indexOf(value.id)==-1){
  128 + that.dingyuenum.push(value.id);
  129 + that.dingyuenum=that.dingyuenum
  130 + }
  131 + }
  132 + })
  133 +
  134 + }).catch(err => {
  135 + console.log(err)
  136 + })
  137 + },
  138 + // 你想要的
  139 + getwant(){
  140 + let that = this;
  141 + var url = "category/getRandCategory"
  142 + let param={
  143 + // cate_one_id:that.cate_one_id,
  144 + // cate_two_id:that.cate_two_id,
  145 + limit:8
  146 + }
  147 + app.post(url, param, "post").then(res => {
  148 + console.log('我想要的', res)
  149 + that.wantlistone=res
  150 +
  151 +
  152 + }).catch(err => {
  153 + console.log(err)
  154 + })
  155 + },
  156 + // 查看更多
  157 + more(){
  158 + uni.navigateTo({
  159 + url:"/pages/xinyuan/zhiboknow"
  160 + })
  161 + }
  162 +
  163 + }
  164 +
  165 + }
  166 +</script>
  167 +
  168 +<style>
  169 + @import url('../../style/xinyuan');
  170 +
  171 + page {
  172 + padding: 0 32rpx;
  173 + box-sizing: border-box;
  174 + }
  175 +
  176 + .searhtoppage {
  177 + padding: 0 32rpx;
  178 + box-sizing: border-box;
  179 + }
  180 + .fuzhi{
  181 + margin-top:92rpx
  182 + }
  183 + .copybtn{
  184 + margin:64rpx auto 32rpx
  185 + }
  186 + .fuzhitext{
  187 + text-align: center;
  188 + }
  189 +</style>
  1 +<template>
  2 + <view class="container">
  3 + <view class="fuzhi">
  4 + <view class="fuzhi">
  5 + <text class='step'>第一步</text>
  6 + 复制口令码
  7 + </view>
  8 + </view>
  9 + <view class='codema'>{{codenumber}}</view>
  10 + <view class="copybtn" @click="copy">复制口令码</view>
  11 + <view class="fuzhik">
  12 + <view class="fuzhi fuzhitwo">
  13 + <text class='step steptwo'>第二步</text>
  14 + 打开{{platform}}点击首页弹窗即可进入
  15 + </view>
  16 + </view>
  17 +
  18 + <view class="want flextwo">
  19 + <view class="goodbox flexone">
  20 + <image src="../../static/today.png" mode="" class="todayimg"></image>
  21 + <view class="todayname">直播好物推荐</view>
  22 + </view>
  23 + <!-- <view class="more flexone">
  24 + 更多
  25 + <img src="../../static/yourow.png" alt="" class="yourow">
  26 + </view> -->
  27 + </view>
  28 + <!-- 商品列表 -->
  29 + <goodlist :zhigoodlist="zhigoodlist" :notixing="notixing" @tixing='tixing' :dingyuenum="dingyuenum"></goodlist>
  30 + </view>
  31 +</template>
  32 +
  33 +<script>
  34 + import app from "../../App.vue";
  35 + import goodlist from "../../compontent/goodlist.vue";
  36 + import {
  37 + Toast
  38 + } from "../../utils/toast.js"
  39 + var that
  40 + export default {
  41 + components: {
  42 + goodlist
  43 + },
  44 + data() {
  45 + return {
  46 + showpull: true,
  47 + page: 1,
  48 + zhigoodlist: [],
  49 + notixing: '',
  50 + codenumber: '',
  51 + dingyuenum:[],
  52 + platform:'',//平台名字s
  53 + }
  54 + },
  55 + onLoad(options) {
  56 + console.log(options)
  57 + this.codenumber = options.code;
  58 + this.platform=options.platform;
  59 + this.getgoodlist()
  60 + },
  61 + onShow() {
  62 + let notixing = uni.getStorageSync("notixing");
  63 + this.notixing = notixing;
  64 + },
  65 + onReachBottom() {
  66 + that = this
  67 + let newpage = that.page;
  68 + newpage++
  69 + that.page = newpage;
  70 + if (that.showpull == true) {
  71 + console.log(38493409)
  72 + Toast('没有更多了~')
  73 + } else {
  74 + that.getgoodlist()
  75 + }
  76 + },
  77 + methods: {
  78 + // 接收子组件的值
  79 + tixing(e) {
  80 + this.zhigoodlist = e
  81 + },
  82 + // 获取直播好物推荐
  83 + getgoodlist() {
  84 + let that = this;
  85 + var url = "goods/getAnchorTimeGoods"
  86 + var param = {
  87 + page: 1,
  88 + per_page: 20
  89 + }
  90 + app.post(url, {}, "post").then(res => {
  91 + console.log('商品列表', res)
  92 + that.zhigoodlist = that.zhigoodlist.concat(res.data);
  93 + if (that.page > 1) {
  94 + if (res.data.length == 0) {
  95 + that.showpull = false
  96 + }
  97 + }
  98 +
  99 + that.zhigoodlist.forEach(function(value,index,array){
  100 + if(value.user_goods==1){
  101 + if(that.dingyuenum.indexOf(value.id)==-1){
  102 + that.dingyuenum.push(value.id);
  103 + that.dingyuenum=that.dingyuenum
  104 + }
  105 + }
  106 + })
  107 + }).catch(err => {
  108 + console.log(err)
  109 + })
  110 + },
  111 + // 复制到剪贴板
  112 + copy() {
  113 + uni.setClipboardData({
  114 + data: this.codenumber
  115 + });
  116 + }
  117 + }
  118 +
  119 + }
  120 +</script>
  121 +
  122 +<style>
  123 + @import url("../../style/xinyuan");
  124 +
  125 + .container {
  126 + padding: 32rpx;
  127 + box-sizing: border-box;
  128 + }
  129 +</style>
  1 +<template>
  2 + <view class="container">
  3 + <!-- 搜索列表 -->
  4 + <view class="searchlist">
  5 + <!-- 搜索人 -->
  6 +
  7 + <view class="searchitem flextwo">
  8 + <view class="searchitemleft flexone">
  9 + <image :src="info.image" mode="" class="headimg"></image>
  10 + <view>
  11 + <view class="searchheadname">{{info.name}}</view>
  12 + <view class="dingtixing flexone">
  13 + <view class="dingtixingitem" style="margin-right:20rpx" >订阅提醒</view>
  14 +
  15 + <view class="dingtixingitem">品类预告微信提醒</view>
  16 + </view>
  17 + </view>
  18 +
  19 + </view>
  20 + <view class="dingyue" v-if="info.user_cate==0" @click="dingyue">订阅直播</view>
  21 + <view class="dingyue" v-if="info.user_cate==1" @click="dingyue">取消订阅</view>
  22 +
  23 + </view>
  24 + <view class="want flextwo">
  25 + <view class="wantleft flexone">
  26 + <image src="../../static/jinzhibo.png" mode="" class="likeimg"></image>
  27 + 近期直播
  28 + </view>
  29 + <view class="more flexone">
  30 + 更多
  31 + <img src="../../static/yourow.png" alt="" class="yourow">
  32 + </view>
  33 + </view>
  34 + <goodlist :zhigoodlist="zhigoodlist" :notixing="notixing" @tixing="tixing" :dingyuenum="dingyuenum"></goodlist>
  35 + <view class="seemore" v-if="jinshowpull" @click="seejinmore">点击查看更多></view>
  36 + <view class="want flextwo">
  37 + <view class="wantleft flexone">
  38 + <image src="../../static/history.png" mode="" class="likeimg"></image>
  39 + 历史直播
  40 + </view>
  41 + <view class="more flexone">
  42 + 更多
  43 + <img src="../../static/yourow.png" alt="" class="yourow">
  44 + </view>
  45 + </view>
  46 + <goodlistone :listshilist="listshilist" :notixing="notixing" @litixing="litixing" :dingyuenumk="dingyuenumk"></goodlistone>
  47 + <view class="seemore" v-if="hisshowpull" @click="seehismore">点击查看更多></view>
  48 +
  49 + <view class="want flextwo" @click="hotmore">
  50 + <view class="wantleft flexone" >
  51 + <image src="../../static/hot.png" mode="" class="likeimg"></image>
  52 + 热门品类推荐
  53 + </view>
  54 + <view class="more flexone">
  55 + 更多
  56 + <img src="../../static/yourow.png" alt="" class="yourow">
  57 + </view>
  58 + </view>
  59 + <goodkind :wantlist="wantlist"></goodkind>
  60 +
  61 + </view>
  62 + </view>
  63 +</template>
  64 +<script>
  65 + import app from "../../App.vue";
  66 + import goodkind from "../../compontent/goodkind.vue"
  67 + import goodlist from "../../compontent/goodlist.vue"
  68 + import goodlistone from "../../compontent/goodlistone.vue"
  69 + export default {
  70 + components: {
  71 + goodkind,
  72 + goodlist,
  73 + goodlistone
  74 + },
  75 + data() {
  76 + return {
  77 + search: false,
  78 + havesou: true,
  79 + goodshow: false,
  80 + cate_one_id:'',//一级级id
  81 + cate_two_id:'',//二级id
  82 + cate_three_id:'',
  83 + wantlist:[],
  84 + zhigoodlist:[],
  85 + listshilist:[],
  86 + jinpage:1,
  87 + hispage:1,
  88 + jinshowpull:true,
  89 + hisshowpull:true,
  90 + info:'',//品类详情
  91 + notixing:'',
  92 + dingyuenum:[],//近期直播
  93 + dingyuenumk:[],//历史直播
  94 + }
  95 + },
  96 + onLoad(options) {
  97 + console.log(options.sanid)
  98 +
  99 + if(options.id){
  100 + this.cate_one_id=options.id//一级级id
  101 + this.gethislist();
  102 + this.getnearlist();
  103 + }
  104 + if(options.secid){
  105 + this.cate_two_id=options.secid //二级id
  106 + this.gethislist();
  107 + this.getnearlist();
  108 + }
  109 + if(options.sanid){
  110 + this.cate_three_id=options.sanid //三级级id
  111 + this.gethislist();
  112 + this.getnearlist();
  113 + }
  114 + console.log(this.cate_three_id,'三级ID')
  115 + this.getsanji();
  116 +
  117 + // 品类详情
  118 + this.getsanjidetail()
  119 + },
  120 + onShow() {
  121 + let notixing = uni.getStorageSync("notixing");
  122 + this.notixing = notixing;
  123 +
  124 + },
  125 + methods: {
  126 + // 获取子组件的值
  127 + tixing(e){
  128 + this.zhigoodlist=e
  129 + },
  130 + litixing(e){
  131 + this.listshilist=e
  132 + },
  133 + // 订阅和取消订阅
  134 + dingyue(){
  135 + console.log(9999)
  136 + let that = this;
  137 + var url = "category/addUserCate"
  138 + let param = {
  139 + cate_id: that.cate_three_id
  140 + }
  141 + app.post(url, param, "post").then(res => {
  142 + console.log('主播订阅', res)
  143 + if(that.info.user_cate==0){
  144 + that.info.user_cate=1
  145 + uni.showToast({
  146 + title:"订阅成功",
  147 + icon:'none'
  148 + })
  149 + }else{
  150 + that.info.user_cate=0
  151 + uni.showToast({
  152 + title:"取消订阅成功",
  153 + icon:'none'
  154 + })
  155 + }
  156 + that.info=that.info;
  157 + that.$forceUpdate()
  158 +
  159 +
  160 + }).catch(err => {
  161 + console.log(err)
  162 + })
  163 + },
  164 + // 获取三级详情
  165 + getsanjidetail(){
  166 + let that = this;
  167 + var url = "category/getCategoryInfo"
  168 + let param={
  169 + cate_id:that.cate_three_id
  170 +
  171 + }
  172 + app.post(url, param, "post").then(res => {
  173 + console.log('品类详情', res)
  174 + that.info=res
  175 +
  176 +
  177 + }).catch(err => {
  178 + console.log(err)
  179 + })
  180 + },
  181 +
  182 + // 获取热门品类
  183 + getsanji(){
  184 + let that = this;
  185 + var url = "category/getRandCategory"
  186 + let param={
  187 + // cate_one_id:that.cate_one_id,
  188 + type:2,
  189 +
  190 + }
  191 + app.post(url, param, "post").then(res => {
  192 + console.log('列表信息', res)
  193 + that.wantlist=res;
  194 + console.log(that.wantlist)
  195 +
  196 + }).catch(err => {
  197 + console.log(err)
  198 + })
  199 + },
  200 + // 近期美妆直播
  201 + getnearlist(){
  202 + let that = this;
  203 + var url = "goods/getAnchorTimeGoods"
  204 + var param={
  205 + cate_one_id:that.cate_one_id,
  206 + cate_two_id:that.cate_two_id,
  207 + cate_three_id:that.cate_three_id,
  208 + type:1,
  209 + page:that.jinpage,
  210 + per_page:20
  211 + }
  212 + app.post(url, param, "post").then(res => {
  213 + console.log('商品列表', res)
  214 + if(res.data.length==0){
  215 + this.jinshowpull=false
  216 + }
  217 + that.zhigoodlist=that.zhigoodlist.concat(res.data);
  218 + that.zhigoodlist.forEach(function(value,index,array){
  219 + if(value.user_goods==1){
  220 + if(that.dingyuenum.indexOf(value.id)==-1){
  221 + that.dingyuenum.push(value.id);
  222 + that.dingyuenum=that.dingyuenum
  223 + }
  224 + }
  225 + })
  226 + console.log(that.zhigoodlist)
  227 +
  228 + }).catch(err => {
  229 + console.log(err)
  230 + })
  231 + },
  232 + // 获取历史直播
  233 + gethislist(){
  234 + let that = this;
  235 + var url = "goods/getAnchorTimeGoods"
  236 + var param={
  237 + cate_one_id:that.cate_one_id,
  238 + cate_two_id:that.cate_two_id,
  239 + cate_three_id:that.cate_three_id,
  240 + type:2,
  241 + page:that.hispage,
  242 + per_page:20
  243 + }
  244 + app.post(url, param, "post").then(res => {
  245 + console.log('商品列表', res)
  246 + if(res.data.length==0){
  247 + that.hisshowpull=false
  248 + }
  249 + that.listshilist=that.listshilist.concat(res.data);
  250 + that.listshilist.forEach(function(value,index,array){
  251 + if(value.user_goods==1){
  252 + if(that.dingyuenumk.indexOf(value.id)==-1){
  253 + that.dingyuenumk.push(value.id);
  254 + that.dingyuenumk=that.dingyuenumk
  255 + }
  256 + }
  257 + })
  258 +
  259 + }).catch(err => {
  260 + console.log(err)
  261 + })
  262 + },
  263 + // 近期直播查看更多
  264 + seejinmore(){
  265 + let newjinpage=this.jinpage;
  266 + newjinpage++;
  267 + this.jinpage=newjinpage;
  268 + if(this.jinshowpull==true){
  269 + this.getnearlist()
  270 + }
  271 +
  272 + },
  273 + //历史美妆查看更多
  274 + seehismore(){
  275 + let newhispage=this.hispage;
  276 + newhispage++;
  277 + this.hispage=newhispage;
  278 + if(this.hisshowpull==true){
  279 + this.gethislist()
  280 + }
  281 + },
  282 + // 热门品类推荐查看更多
  283 + hotmore(){
  284 + uni.navigateTo({
  285 + url:'/pages/xinyuan/zhiboknow'
  286 + })
  287 + }
  288 +
  289 +
  290 +
  291 + }
  292 +
  293 + }
  294 +</script>
  295 +
  296 +<style>
  297 + @import url('../../style/xinyuan');
  298 +
  299 + page {
  300 + padding: 0 32rpx;
  301 + box-sizing: border-box;
  302 + }
  303 + .searchlist{
  304 + margin-top:0
  305 + }
  306 +
  307 +
  308 + .seemore{
  309 + color: #FF0000;
  310 + font-size: 28rpx;
  311 + text-align: center;
  312 + margin-top:20rpx;
  313 + }
  314 +
  315 + .searhtoppage {
  316 + padding: 0 32rpx;
  317 + box-sizing: border-box;
  318 + }
  319 +
  320 + .fuzhi {
  321 + margin-top: 92rpx
  322 + }
  323 +
  324 + .copybtn {
  325 + margin: 64rpx auto 32rpx
  326 + }
  327 +
  328 + .fuzhitext {
  329 + text-align: center;
  330 + }
  331 +</style>
  1 +<template>
  2 + <view class="container">
  3 + <view class="searhtoppage flextwo">
  4 + <view class="searchtopk flextwo">
  5 + <image src="../../static/search.png" mode="" class="search"></image>
  6 + <view class='searchleft'>
  7 +
  8 + <input type="text" placeholder="输入您搜索的内容" v-model="keyword" @blur="searchbtn" />
  9 + </view>
  10 +
  11 + </view>
  12 + <view class="cancelname" @click="cancel">取消</view>
  13 + </view>
  14 + <!-- 搜索 -->
  15 + <view class="searchbox" v-if="search">
  16 + <view>
  17 + <view class="searchboxtop flextwo">
  18 + <view class='searchboxleft flexone'>
  19 + <view class="hotname">历史搜索</view>
  20 + </view>
  21 + <view class="qingkong flexone" @click="clear">
  22 + <view class="qingkongname">清空</view>
  23 + <image src="../../static/shanchu.png" mode="" class="delimg"></image>
  24 + </view>
  25 +
  26 +
  27 + </view>
  28 + <view class="nodata" v-if="searchhis.length==0">暂无数据</view>
  29 + <view class="lishibox flexone" v-else>
  30 + <view class="lishoboxitme" v-for="(item,index) in searchhis" :key="index" @click="searchitem(item)">{{item}}</view>
  31 + </view>
  32 + </view>
  33 +
  34 + <view class="searchboxtop flextwo" @click="more">
  35 + <view class='searchboxleft flexone'>
  36 + <image src="../../static/hot.png" mode="" class="hot"></image>
  37 + <view class="hotname">热门品类推荐</view>
  38 + </view>
  39 + <view class="more flexone">
  40 + 更多
  41 + <img src="../../static/yourow.png" alt="" class="yourow">
  42 + </view>
  43 + </view>
  44 + <goodkind :wantlist="wantlist"></goodkind>
  45 + </view>
  46 + <!-- 搜索列表 -->
  47 + <view class="searchlist" v-else>
  48 + <!--有搜搜结果 -->
  49 +
  50 +
  51 + <view class="searchitem flextwo" v-if="anchor.length!=0">
  52 + <view class="searchitemleft flexone" @click="enterpeople(anchor.id)">
  53 + <image :src="anchor.avatar" mode="" class="headimg"></image>
  54 + <view class="searchheadname">{{anchor.name}}</view>
  55 + </view>
  56 + <view class="dingyue" v-if="anchor.user_anchor==0" @click="dingyuepeople">订阅直播</view>
  57 + <view class="canceltixing" v-else @click="dingyuepeople">取消订阅</view>
  58 +
  59 + </view>
  60 + <view class="searchitem flextwo" v-if="cate.length!=0">
  61 + <view class="searchitemleft flexone">
  62 + <image :src="cate.image" mode="" class="headimg"></image>
  63 + <view class="searchheadname">{{cate.name}}</view>
  64 + </view>
  65 + <view class="dingyue" v-if="cate.user_cate==0" @click="dingyuezhibo">订阅直播</view>
  66 + <view class="canceltixing" v-else @click="dingyuezhibo">取消订阅</view>
  67 +
  68 +
  69 + </view>
  70 +
  71 + <view class="want flextwo">
  72 + <view class="wantleft flexone">
  73 + <image src="../../static/zan.png" mode="" class="likeimg"></image>
  74 + 与“{{keyword}}”有关的直播
  75 + </view>
  76 + <view class="more flexone">
  77 + 更多
  78 + <img src="../../static/yourow.png" alt="" class="yourow">
  79 + </view>
  80 + </view>
  81 + <view>
  82 + <view class="nodata" v-if="zhigoodlist.length==0">暂无数据</view>
  83 + <view v-else>
  84 + <!-- 商品列表 -->
  85 + <goodlist :zhigoodlist="zhigoodlist"></goodlist>
  86 +
  87 + </view>
  88 +
  89 + </view>
  90 +
  91 +
  92 +
  93 + <view class="want flextwo" @click='more'>
  94 + <view class='searchboxleft flexone'>
  95 + <image src="../../static/hot.png" mode="" class="hot"></image>
  96 + <view class="hotname">热门品类推荐</view>
  97 + </view>
  98 + <view class="more flexone">
  99 + 更多
  100 + <img src="../../static/yourow.png" alt="" class="yourow">
  101 + </view>
  102 + </view>
  103 + <goodkind :wantlist="wantlist"></goodkind>
  104 +
  105 +
  106 +
  107 + </view>
  108 + </view>
  109 +</template>
  110 +<script>
  111 + import app from "../../App.vue";
  112 + import goodkind from "../../compontent/goodkind.vue"
  113 + import goodlist from "../../compontent/goodlist.vue"
  114 + import {
  115 + Toast
  116 + } from "../../utils/toast.js"
  117 + var that
  118 + export default {
  119 + components: {
  120 + goodkind,
  121 + goodlist
  122 + },
  123 + data() {
  124 + return {
  125 + search: true,
  126 + havesou: false,
  127 + goodshow: false,
  128 + wantlist: [],
  129 + keyword: '',
  130 + zhigoodlist: [],
  131 + showpull: true,
  132 + page: 1,
  133 + searchhis: [],
  134 + anchor: '',
  135 + cate: ''
  136 + }
  137 + },
  138 + onReachBottom() {
  139 + that = this
  140 + let newpage = that.page;
  141 + newpage++
  142 + that.page = newpage;
  143 + if (that.showpull == true) {
  144 + console.log(38493409)
  145 + Toast('没有更多了~')
  146 + } else {
  147 + that.getsearchresult()
  148 + }
  149 + },
  150 + onLoad() {
  151 + // 获取热门品类
  152 + this.getwant()
  153 + // 获取搜索列表
  154 + this.getsoulist()
  155 + },
  156 + methods: {
  157 + cancel() {
  158 + this.search = true;
  159 + this.keyword = ''
  160 + this.getsoulist()
  161 + },
  162 + // 获取搜索列表
  163 + getsoulist() {
  164 + let that = this;
  165 + var url = "keyword_log/getKeyword"
  166 + let param = {
  167 +
  168 + }
  169 + app.post(url, param, "post").then(res => {
  170 + console.log('搜索列表', res)
  171 + that.searchhis = res
  172 + }).catch(err => {
  173 + console.log(err)
  174 + })
  175 + },
  176 + // 热门品类
  177 + getwant() {
  178 + let that = this;
  179 + var url = "category/getRandCategory"
  180 + let param = {
  181 + type: 2,
  182 + limit: 8
  183 + }
  184 + app.post(url, param, "post").then(res => {
  185 + console.log('我想要的', res)
  186 + that.wantlist = res
  187 +
  188 + }).catch(err => {
  189 + console.log(err)
  190 + })
  191 + },
  192 + // 清空搜素记录
  193 + clear() {
  194 + let that = this;
  195 + uni.showModal({
  196 + title: '',
  197 + content: '是否清空搜索记录',
  198 + success: function(res) {
  199 + if (res.confirm) {
  200 +
  201 + var url = "keyword_log/delKeyword"
  202 + let param = {
  203 +
  204 + }
  205 + app.post(url, param, "post").then(res => {
  206 + Toast("删除成功");
  207 + that.searchhis = []
  208 +
  209 + }).catch(err => {
  210 + console.log(err)
  211 + })
  212 + } else if (res.cancel) {
  213 + console.log('用户点击取消');
  214 + }
  215 + }
  216 + });
  217 + },
  218 + // 获取搜索
  219 + searchbtn() {
  220 + this.search = false;
  221 + this.page=1;
  222 + this.zhigoodlist=[];
  223 + this.getsearchresult();
  224 + },
  225 + // 获取搜索结果
  226 + getsearchresult() {
  227 + let that = this;
  228 + var url = "goods/search"
  229 + let param = {
  230 + keyword: that.keyword,
  231 + page: that.page,
  232 + per_apge: 20
  233 + }
  234 + app.post(url, param, "post").then(res => {
  235 + console.log('搜索结果', res)
  236 + that.anchor = res.anchor;
  237 + that.cate = res.cate
  238 + that.zhigoodlist = that.zhigoodlist.concat(res.list.data);
  239 + if (that.page > 1) {
  240 + if (res.list.data == 0) {
  241 + that.showpull = false
  242 + }
  243 + }
  244 +
  245 + }).catch(err => {
  246 + console.log(err)
  247 + })
  248 + },
  249 + // 热门推荐更多
  250 + more() {
  251 + uni.navigateTo({
  252 + url: '/pages/xinyuan/zhiboknow'
  253 + })
  254 + },
  255 + // 订阅人
  256 + dingyuepeople() {
  257 + let that = this;
  258 + var url = "anchor/addUserAnchor"
  259 + let param = {
  260 + anchor_id: that.anchor.id
  261 + }
  262 + app.post(url, param, "post").then(res => {
  263 + console.log('搜索结果', res)
  264 + if (that.anchor.user_anchor == 0) {
  265 + that.anchor.user_anchor = 1;
  266 + Toast("订阅成功")
  267 + } else {
  268 + that.anchor.user_anchor = 0;
  269 + Toast("取消订阅成功")
  270 + }
  271 + that.anchor = that.anchor;
  272 + that.$forceUpdate()
  273 +
  274 +
  275 +
  276 + }).catch(err => {
  277 + console.log(err)
  278 + })
  279 + },
  280 +
  281 + // 订阅品类
  282 + dingyuezhibo() {
  283 + let that = this;
  284 + var url = "category/addUserCate"
  285 + let param = {
  286 + cate_id: that.cate.id
  287 + }
  288 + app.post(url, param, "post").then(res => {
  289 + console.log('搜索结果', res)
  290 + if (that.cate.user_cate == 0) {
  291 + that.anchor.user_cate = 1;
  292 + Toast("订阅成功")
  293 + } else {
  294 + that.anchor.user_cate = 0;
  295 + Toast("取消订阅成功")
  296 + }
  297 + that.cate = that.cate;
  298 + that.$forceUpdate()
  299 +
  300 + }).catch(err => {
  301 + console.log(err)
  302 + })
  303 + },
  304 + searchitem(item) {
  305 + this.keyword = item;
  306 + this.getsearchresult();
  307 + this.search = false
  308 + },
  309 + // 进入主播详情
  310 + enterpeople(id){
  311 + console.log(id)
  312 + uni.navigateTo({
  313 + url:'/pages/xinyuan/zhibodetail?id='+id
  314 + })
  315 +
  316 + }
  317 + }
  318 +
  319 + }
  320 +</script>
  321 +
  322 +<style>
  323 + @import url('../../style/xinyuan');
  324 +
  325 + page {
  326 + padding: 0 32rpx;
  327 + box-sizing: border-box;
  328 + }
  329 +
  330 + .searhtoppage {
  331 + padding: 0 32rpx;
  332 + box-sizing: border-box;
  333 + }
  334 +
  335 + .fuzhi {
  336 + margin-top: 92rpx
  337 + }
  338 +
  339 + .copybtn {
  340 + margin: 64rpx auto 32rpx
  341 + }
  342 +
  343 + .fuzhitext {
  344 + text-align: center;
  345 + }
  346 +
  347 + .lishibox {
  348 + margin-top: 24rpx;
  349 + flex-wrap: wrap;
  350 + }
  351 +
  352 + .lishoboxitme {
  353 + background: #f7f8fa;
  354 + border-radius: 8rpx;
  355 + padding: 8rpx 16rpx;
  356 + box-sizing: border-box;
  357 + color: #252F3E;
  358 + font-size: 24rpx;
  359 + margin-bottom: 20rpx;
  360 + margin-right: 10rpx;
  361 + }
  362 +
  363 + .canceltixing {
  364 + width: 144rpx;
  365 + height: 48rpx;
  366 + background: #bbbbbb;
  367 + border-radius: 10rpx;
  368 + color: #fff;
  369 + font-size: 24rpx;
  370 + text-align: center;
  371 + line-height: 48rpx;
  372 + }
  373 +</style>
  1 +<template>
  2 + <view class="container">
  3 + <view class="searhtoppage">
  4 + <view class="searchtop flextwo" @click="search">
  5 + <view class='searchleft'>
  6 + 输入您搜索的内容
  7 + <!-- <input type="text" placeholder="输入您搜索的内容" /> -->
  8 + </view>
  9 + <image src="../../static/search.png" mode="" class="search"></image>
  10 + </view>
  11 + </view>
  12 + <view class="xinyuanbox">
  13 + <view class="gookindpage flexone">
  14 + <view class="goodkindleft" @click='all("")'>
  15 + <view class="goodkindname">全部品类</view>
  16 + <view class="secname allname">香奈儿奢华至臻</view>
  17 + <view class="goodkindimgbox">
  18 + <view class="gookindimg">
  19 + <image src="../../static/goodimg.png" mode=""></image>
  20 + </view>
  21 + </view>
  22 + </view>
  23 + <view class="goodkindright">
  24 + <view class="goodkindrighttop flexone" @click='all(kindlist[0].id)'>
  25 + <view>
  26 + <view class="goodkindname">{{kindlist[0].name}}</view>
  27 + <view class="secname">{{kindlist[0].description}}</view>
  28 + </view>
  29 +
  30 + <view class="gookindimgk">
  31 + <image :src="kindlist[0].image" mode=""></image>
  32 + </view>
  33 +
  34 + </view>
  35 + <view class="goodkindrighttopge flexone" @click='all(kindlist[1].id)'>
  36 + <view>
  37 + <view class="goodkindname">{{kindlist[1].name}}</view>
  38 + <view class="secname">{{kindlist[1].description}}</view>
  39 + </view>
  40 +
  41 +
  42 + <view class="gookindimgk">
  43 + <image :src="kinlist[1].image" mode=""></image>
  44 + </view>
  45 +
  46 + </view>
  47 + </view>
  48 + </view>
  49 + <view class="xinyuanbotbox flextwo">
  50 + <view class="xinyuanbotitem flexone" @click='all(kindlist[2].id)'>
  51 + <view>
  52 + <view class="goodkindnamek">{{kindlist[2].name}}</view>
  53 + <view class="secnamek">{{kindlist[2].description}}</view>
  54 + </view>
  55 +
  56 + <view class="goodkindimg">
  57 + <image :src="kindlist[2].image" mode=""></image>
  58 + </view>
  59 + </view>
  60 + <view class="xinyuanbotitem flexone" @click='all(kindlist[3].id)'>
  61 + <view>
  62 + <view class="goodkindnamek">{{kindlist[3].name}}</view>
  63 + <view class="secnamek">{{kindlist[3].description}}</view>
  64 + </view>
  65 +
  66 + <view class="goodkindimg">
  67 + <image :src="kindlist[3].image" mode=""></image>
  68 + </view>
  69 + </view>
  70 + <view class="xinyuanbotitem flexone" @click='all(kindlist[4].id)'>
  71 + <view>
  72 + <view class="goodkindnamek">{{kindlist[4].name}}</view>
  73 + <view class="secnamek">{{kindlist[4].description}}</view>
  74 + </view>
  75 +
  76 + <view class="goodkindimg">
  77 + <image :src="kindlist[4].image" mode=""></image>
  78 + </view>
  79 + </view>
  80 +
  81 + </view>
  82 + <!-- 直播好物推荐 -->
  83 + <view class="goodbox flexone">
  84 + <image src="../../static/today.png" mode="" class="todayimg"></image>
  85 + <view class="todayname">直播好物推荐</view>
  86 + </view>
  87 + <!-- 商品列表 -->
  88 + <goodlist :zhigoodlist="zhigoodlist" :notixing="notixing" @tixing='tixing' :dingyuenum="dingyuenum"></goodlist>
  89 + <!-- 这里也有你想要的 -->
  90 + <view class="want flextwo">
  91 + <view class="wantleft flexone">
  92 + <image src="../../static/like.png" mode="" class="likeimg"></image>
  93 + 也许这里也又你想要的
  94 + </view>
  95 + <view class="more flexone" @click="more">
  96 + 更多
  97 + <img src="../../static/yourow.png" alt="" class="yourow">
  98 + </view>
  99 + </view>
  100 + <goodkind :wantlist="wantlist"></goodkind>
  101 + </view>
  102 +
  103 + </view>
  104 +</template>
  105 +<script>
  106 + import app from "../../App.vue";
  107 + import goodlist from "../../compontent/goodlist.vue";
  108 + import goodkind from "../../compontent/goodkind.vue";
  109 + import {
  110 + Toast
  111 + } from "../../utils/toast.js"
  112 + var that
  113 + export default {
  114 + components: {
  115 + goodlist,
  116 + goodkind
  117 + },
  118 + data() {
  119 + return {
  120 + // 列表
  121 + kindlist: [],
  122 + showpull: true,
  123 + wantlist: [],
  124 + page: 1,
  125 + zhigoodlist: [],
  126 + notixing:'',
  127 + dingyuenum:[]
  128 + }
  129 + },
  130 +
  131 + onReachBottom() {
  132 + that = this
  133 + let newpage = that.page;
  134 + newpage++
  135 + that.page = newpage;
  136 + if (that.showpull == true) {
  137 + console.log(38493409)
  138 + Toast('没有更多了~')
  139 + } else {
  140 + that.getgoodlist()
  141 + }
  142 + },
  143 + onShow() {
  144 + let notixing = uni.getStorageSync("notixing");
  145 + this.notixing = notixing;
  146 + console.log(this.notixing)
  147 + this.page=1;
  148 + this.zhigoodlist=[]
  149 + // 获取直播好物
  150 + this.getgoodlist();
  151 + },
  152 + onLoad() {
  153 + this.gettopkind();
  154 + // 获取你想要的
  155 + this.getwant()
  156 + },
  157 + methods: {
  158 + // 接收子组件的值
  159 + tixing(e) {
  160 + this.zhigoodlist = e;
  161 + },
  162 +
  163 + // 获取顶部列表
  164 + gettopkind() {
  165 + let that = this;
  166 + var url = "category/getIndexCategory"
  167 + app.post(url, {}, "post").then(res => {
  168 + console.log('列表信息', res)
  169 + that.kindlist = res;
  170 + console.log(that.kindlist)
  171 +
  172 + }).catch(err => {
  173 + })
  174 + },
  175 + // 获取直播好物推荐
  176 + getgoodlist() {
  177 + let that = this;
  178 + var url = "goods/getAnchorTimeGoods"
  179 + var param = {
  180 + page: 1,
  181 + per_page: 20
  182 + }
  183 + app.post(url, {}, "post").then(res => {
  184 + console.log('商品列表', res)
  185 + that.zhigoodlist = that.zhigoodlist.concat(res.data);
  186 + if (that.page > 1) {
  187 + if (res.data.length == 0) {
  188 + that.showpull = false
  189 + }
  190 + }
  191 + that.zhigoodlist.forEach(function(value,index,array){
  192 + if(value.user_goods==1){
  193 + if(that.dingyuenum.indexOf(value.id)==-1){
  194 + that.dingyuenum.push(value.id);
  195 + that.dingyuenum=that.dingyuenum
  196 + }
  197 + }
  198 + })
  199 +
  200 +
  201 + }).catch(err => {
  202 + console.log(err)
  203 + })
  204 + },
  205 + // 你想要的
  206 + getwant() {
  207 + let that = this;
  208 + var url = "category/getRandCategory"
  209 + let param = {
  210 + type: 2,
  211 + limit: 8
  212 + }
  213 + app.post(url, param, "post").then(res => {
  214 + console.log('我想要的', res)
  215 + that.wantlist = res
  216 +
  217 +
  218 + }).catch(err => {
  219 + console.log(err)
  220 + })
  221 + },
  222 + // 更多分类
  223 + more() {
  224 + uni.navigateTo({
  225 + url: "/pages/xinyuan/zhiboknow"
  226 + })
  227 + },
  228 + // 进入搜索页面
  229 + search() {
  230 + uni.navigateTo({
  231 + url: '/pages/xinyuan/search'
  232 + })
  233 + },
  234 + // 进入分类页面
  235 + all(id){
  236 + uni.navigateTo({
  237 + url:'/pages/xinyuan/zhiboknow?id='+id
  238 + })
  239 + }
  240 +
  241 +
  242 + }
  243 +
  244 + }
  245 +</script>
  246 +
  247 +<style>
  248 + @import url('../../style/xinyuan');
  249 +</style>
  1 +<template>
  2 + <view class="container">
  3 + <view class="zhibotopbox">
  4 + <view class="zhibotaltop flexone">
  5 + <view class="zhibohead">
  6 + <image :src="info.avatar" mode=""></image>
  7 + </view>
  8 + <view class="zhiboright">
  9 + <view class="zhubotail flextwo">
  10 + <view class="tailrighttop flexone">
  11 + <view class="tailname">{{info.name}}</view>
  12 + <view class="taillabel">{{info.platform}}</view>
  13 + </view>
  14 + <view class="shareimg">
  15 + <image src="../../static/share.png" mode="" class="sharebtn"></image>
  16 + <button open-type="share" class="shartype"></button>
  17 + </view>
  18 + </view>
  19 +
  20 + <view class='tailrightbot flexone'>
  21 + <view class="tailzhibo" v-if="info.user_anchor==0" @click="dingyuezhi">订阅直播</view>
  22 + <view class="tailzhibo" v-if="info.user_anchor==1" @click="dingyuezhi">取消订阅</view>
  23 + <view class='taildate' v-if="info.anchor_time!=null">{{info.anchor_time.time}}开播</view>
  24 + </view>
  25 + <view class="dongtai flexone" v-if="info.user_anchor==0&&guanzhu==0" @click="hidegaunzhu">
  26 + <veiw>订阅主播,随时获取主播动态</veiw>
  27 + <view class="chahaoimg">
  28 + <img src="../../static/chahao.png" alt="" >
  29 + </view>
  30 +
  31 + </view>
  32 +
  33 + </view>
  34 + </view>
  35 + <view class="zhibonametext" v-if="info.anchor_time!=null">{{info.anchor_time.title}}</view>
  36 + </view>
  37 + <view class="zhibotailtab flextwo">
  38 + <view class="zhibotailtableft" :class="begin==1?'zhibotailactive':''" @click="beginstart(1)">即将开始</view>
  39 + <view class="zhibotailtableft" :class="begin==2?'zhibotailactive':''" @click="beginstart(2)">历史场次</view>
  40 + <img src="../../static/search.png" alt="" class="souimg" @click='searchenter'>
  41 + </view>
  42 + <!-- 即将开始 -->
  43 + <view class='beginlist' v-if="begin==1">
  44 + <!-- v-if="info.button==true" -->
  45 + <view class='beginlisttop flexone' v-if="button">
  46 + <view class="begintopitem" :class="sel==''?'selactive':''" @click="select('')">所有商品</view>
  47 + <view class="begintopitem" :class="sel==1?'selactive':''" @click="select('1')">今天</view>
  48 + <view class="begintopitem" :class="sel==2?'selactive':''" @click="select('2')">明天</view>
  49 + </view>
  50 + <view>
  51 +
  52 + </view>
  53 + <view v-if="beginlist.length!=0">
  54 + <view v-for="(item,index) in beginlist" :key="index">
  55 + <view class="want flextwo">
  56 + <view class="wantleft flexone">
  57 + <image src="../../static/meizhuanglei.png" mode="" class="likeimg"></image>
  58 + {{item.name}}
  59 + </view>
  60 + <!-- <view class="more flexone">
  61 + 更多
  62 + <img src="../../static/yourow.png" alt="" class="yourow">
  63 + </view> -->
  64 + </view>
  65 + <view class="goodlist">
  66 + <view class="goodlistitem flex" v-for="(itemk,indexk) in item.child" :key="indexk" @click="entergood(itemk)">
  67 + <view class="goodlistimg">
  68 + <image :src="itemk.image" mode=""></image>
  69 + </view>
  70 + <view class="goodlistright">
  71 + <view class="goodrighttop flextwo">
  72 + <view class="goodname">{{itemk.name}}</view>
  73 + <view class="shareimg">
  74 + <image src="../../static/share.png" mode="" class="sharebtn"></image>
  75 + <button open-type="share" class="shartype"></button>
  76 + </view>
  77 + </view>
  78 + <view class="zhibo flextwo">
  79 + <view class="zhiboleft">{{itemk.anchor.name}}{{itemk.anchor.platform}}</view>
  80 + <view class="kaibo">{{itemk.anchor_time.time}}开播</view>
  81 + </view>
  82 + <view class="zhiboprice">
  83 + 直播价 ¥<text class="pricege">{{itemk.live_price}}</text>
  84 + </view>
  85 + <view class="cankao flextwo">
  86 + <view class="cankaoleft">参考价(京东¥{{itemk.r_price}}元)</view>
  87 + <view v-if="itemk.status_data==1">
  88 + <view v-if="itemk.user_goods==0">
  89 + <view class="canlaoright flexone" v-if="itemk.share==true" >
  90 + <image src="../../static/naoling.png" mode="" class="naoling"></image>
  91 + 提醒我
  92 + <button open-type="share" class="sharebtnk" v-if="notixing==1" @click.stop="sharefriend(index,indexk,itemk.id,item.share)"></button>
  93 + </view>
  94 + <view class="canlaoright flexone" v-else @click.stop="tixing(index,indexk,itemk.id)">
  95 + <image src="../../static/naoling.png" mode="" class="naoling"></image>
  96 + 提醒我
  97 + </view>
  98 +
  99 + </view>
  100 + <view class="canceltixing" v-else @click.stop="canceltixing(index,indexk,itemk.id)">
  101 + 取消提醒
  102 + </view>
  103 + </view>
  104 + <view v-if="itemk.status_data==2">
  105 + <view class="canlaoright flexone" >
  106 + 已上架
  107 + </view>
  108 + </view>
  109 +
  110 + </view>
  111 + </view>
  112 + </view>
  113 +
  114 + </view>
  115 +
  116 + </view>
  117 + </view>
  118 +
  119 + <!-- 这里也有你想要的 -->
  120 + <view class="want flextwo" >
  121 + <view class="wantleft flexone">
  122 + <image src="../../static/like.png" mode="" class="likeimg"></image>
  123 + 也许这里也又你想要的
  124 + </view>
  125 + <!-- <view class="more flexone" @click="seemore">
  126 + 更多
  127 + <img src="../../static/yourow.png" alt="" class="yourow">
  128 + </view> -->
  129 + </view>
  130 + <goodkind :wantlist="wantlist"></goodkind>
  131 + <!-- 没有直播时显示 -->
  132 + <view class="nodatabox" v-if="beginlist.length==0">
  133 + <view class="nodataimg">
  134 + <image src="../../static/nodataimg.png" mode=""></image>
  135 + </view>
  136 + <view class="nodataword">当前主播还未发布预告,点击订阅TA的预告提醒</view>
  137 + <view class="nodatabtn" @click="dingyuezhi" v-if="info.user_anchor==0">订阅TA的预告提醒</view>
  138 + <view class="nodatabtn" @click="dingyuezhi" v-if="info.user_anchor==1">取消订阅TA的预告提醒</view>
  139 + </view>
  140 + </view>
  141 + <!-- 历史场次 -->
  142 + <view class="zhibotaillist" v-else>
  143 + <view class="nodata" v-if="hislist.length==0">暂无数据</view>
  144 + <view v-else>
  145 + <view class="zhibotialitem flextwo" v-for="(item,index) in hislist" :key="index" @click="zhidetail(item.id)">
  146 + <view class='zhibotialleft'>
  147 + <view class='zhibotailleftname'>{{item.title}}</view>
  148 + <view class="zhibotaildate">{{item.time}}</view>
  149 + </view>
  150 + <view class="yourowk">
  151 + <image src="../../static/yourow.png" mode=""></image>
  152 + </view>
  153 + </view>
  154 + </view>
  155 + </view>
  156 + <!-- 弹出层 -->
  157 + <view class="register" v-if="noshow" @click="hideding">
  158 + <view class="registerwrap">
  159 + <view class="title">何时提醒我?</view>
  160 + <view class="titletext">在主播开始介绍商品时就提醒您</view>
  161 + <view class="title">如何提醒我</view>
  162 + <view class="titletext">在你允许消息通知后,届时会给您发送微信消息提醒</view>
  163 + <view class='noti flexone' @click="notibtn">
  164 + <image src="../static/selectzhong.png" mode="" class="selectxuan" v-if="noti"></image>
  165 + <image src="../static/select.png" mode="" class="selectxuan" v-else></image>
  166 +
  167 + 不再提示
  168 + </view>
  169 + <button class="buzai" @click.stop="know" v-if="share==true" open-type="share">我知道了</button>
  170 + <view class="buzai" @click.stop="know" v-else>我知道了</view>
  171 + </view>
  172 + </view>
  173 +
  174 +
  175 + </view>
  176 +</template>
  177 +
  178 +<script>
  179 + import app from "../../App.vue";
  180 + import goodkind from "../../compontent/goodkind.vue"
  181 + import {Toast} from "../../utils/toast.js"
  182 + var that
  183 + export default {
  184 + components: {
  185 + goodkind
  186 + },
  187 + data() {
  188 + return {
  189 + begin: 1,
  190 + hasgood: false,
  191 + zhiboid: "",
  192 + info: '',
  193 + sel: '',
  194 + beginlist:[],
  195 + page:1,
  196 + wantlist:[],
  197 + hislist:[],
  198 + showpull:true,
  199 + notixing:'',
  200 + goods_id: '',
  201 + noti: false, //提示和不提示按钮
  202 + noshow: false, //提示我弹出层
  203 + goodindex: '',
  204 + goodparindex:'',
  205 + share:'',
  206 + button:false,//是否显示所有商品 今天 明天
  207 + guanzhu:0,//是否显示主播动态
  208 + dingyuenum:[],
  209 +
  210 + }
  211 + },
  212 + onLoad(options) {
  213 + if(uni.getStorageSync("guanzhu")){
  214 + this.guanzhu=uni.getStorageSync("guanzhu")
  215 + }
  216 + this.zhiboid = options.id;
  217 + // 获取主播详情
  218 + this.getzhibodetail();
  219 + this.getbeginlist();
  220 + // 获取想要的
  221 + this.getwant()
  222 +
  223 +
  224 + },
  225 + onShow() {
  226 + let notixing = uni.getStorageSync("notixing");
  227 + this.notixing = notixing;
  228 + },
  229 + onShareAppMessage(res) {
  230 + let that = this;
  231 + if (res.from === 'button') { // 来自页面内分享按钮
  232 + console.log(res.target)
  233 + }
  234 + return {
  235 + title: '早直播',
  236 + path:'/pages/xinyuan/zhibodetail?id='+this.zhiboid
  237 + }
  238 + },
  239 + onReachBottom() {
  240 + that=this
  241 + let newpage=that.page;
  242 + newpage++
  243 + that.page=newpage;
  244 + if(that.showpull==true){
  245 + console.log(38493409)
  246 + Toast('没有更多了~')
  247 + }else{
  248 + if(this.begin==1){
  249 + that.getbeginlist()
  250 + }else{
  251 + this.gethislist()
  252 + }
  253 +
  254 + }
  255 + },
  256 + methods: {
  257 + // 关注关注
  258 + hidegaunzhu(){
  259 + uni.setStorageSync("guanzhu",1)
  260 + this.guanzhu=1
  261 + },
  262 + // 查看更多
  263 + seemore() {
  264 + uni.navigateTo({
  265 + url: "/pages/xinyuan/zhiboknow"
  266 + })
  267 + },
  268 + beginstart(id) {
  269 + this.begin = id;
  270 + this.page=1;
  271 + this.beginlist=[];
  272 + this.hislist=[]
  273 + if(id==1){
  274 + this.getbeginlist()
  275 + }else{
  276 + this.gethislist()
  277 + }
  278 + },
  279 + // 全部 今天 明天
  280 + select(id) {
  281 + this.sel = id;
  282 + this.page=1;
  283 + this.beginlist=[];
  284 + this.getbeginlist()
  285 + },
  286 + // 直播详情
  287 + getzhibodetail() {
  288 + let that = this;
  289 + var url = "anchor/getAnchorInfo"
  290 + let param = {
  291 + anchor_id: that.zhiboid
  292 + }
  293 + app.post(url, param, "post").then(res => {
  294 + console.log('主播详情', res)
  295 + that.info=res;
  296 + that.button=res.button;
  297 + that.$forceUpdate();
  298 +
  299 + }).catch(err => {
  300 + console.log(err)
  301 + })
  302 + },
  303 + // 订阅直播
  304 + dingyuezhi(){
  305 + console.log(9999)
  306 + let that = this;
  307 + var url = "anchor/addUserAnchor"
  308 + let param = {
  309 + anchor_id: that.zhiboid
  310 + }
  311 + app.post(url, param, "post").then(res => {
  312 + console.log('主播订阅', res)
  313 + if(that.info.user_anchor==0){
  314 + that.info.user_anchor=1;
  315 + uni.showToast({
  316 + title:'订阅成功',
  317 + icon:'none'
  318 +
  319 + })
  320 + }else{
  321 + that.info.user_anchor=0;
  322 + uni.showToast({
  323 + title:'取消订阅成功',
  324 + icon:'none'
  325 +
  326 + })
  327 + }
  328 + that.info=that.info;
  329 + that.$forceUpdate()
  330 +
  331 +
  332 + }).catch(err => {
  333 + console.log(err)
  334 + })
  335 + },
  336 +
  337 + // 获取即将开播
  338 + getbeginlist() {
  339 + let that = this;
  340 + var url = "anchor/getAnchorGoods"
  341 + let param = {
  342 + anchor_id: that.zhiboid,
  343 + type: that.sel,
  344 + page: that.page,
  345 + per_page: 20
  346 + }
  347 + app.post(url, param, "post").then(res => {
  348 + console.log('即将开播', res)
  349 + that.beginlist=that.beginlist.concat(res)
  350 + if(that.page>1){
  351 + if(res.data.length==0){
  352 + that.showpull=false
  353 + }
  354 + }
  355 + that.beginlist.forEach(function(value,index,array){
  356 + value.child.forEach(function(valuek,indexk,arrayk){
  357 + if(valuek.user_goods==1){
  358 + if(that.dingyuenum.indexOf(valuek.id)==-1){
  359 + that.dingyuenum.push(valuek.id);
  360 + that.dingyuenum=that.dingyuenum
  361 + }
  362 + }
  363 + })
  364 +
  365 + })
  366 + console.log('订阅数量',that.dingyuenum)
  367 +
  368 + }).catch(err => {
  369 + console.log(err)
  370 + })
  371 + },
  372 + gethislist(){
  373 + let that = this;
  374 + var url = "anchor/getAnchorTime"
  375 + let param = {
  376 + anchor_id: that.zhiboid,
  377 + page: that.page,
  378 + per_page: 20
  379 + }
  380 + app.post(url, param, "post").then(res => {
  381 + console.log('历史列表', res)
  382 + that.hislist=that.hislist.concat(res.data);
  383 + if(that.page>1){
  384 + if(res.data.length==0){
  385 + that.showpull=false
  386 + }
  387 + }
  388 +
  389 + }).catch(err => {
  390 + console.log(err)
  391 + })
  392 + },
  393 + // 你想要的
  394 + getwant(){
  395 + let that = this;
  396 + var url = "category/getRandCategory"
  397 + let param={
  398 + limit:8
  399 + }
  400 + app.post(url, param, "post").then(res => {
  401 + console.log('我想要的', res)
  402 + that.wantlist=res
  403 +
  404 +
  405 + }).catch(err => {
  406 + console.log(err)
  407 + })
  408 + },
  409 +
  410 + // 订阅消息
  411 + tixing(index,indexk,id) {
  412 + console.log(99)
  413 + let that = this;
  414 + if (uni.getStorageSync("token")) {
  415 + if (that.notixing == '') {
  416 + that.noshow = true
  417 + } else {
  418 + that.noshow = false
  419 + }
  420 + that.goodindex = indexk;
  421 + that.goodparindex=index;
  422 + this.goods_id = id;
  423 + // that.dingyue()
  424 +
  425 + wx.getSetting({
  426 + // withSubscriptions: true,//是否获取用户订阅消息的订阅状态,默认false不返回
  427 + success(res) {
  428 + if (res.authSetting['scope.subscribeMessage']) {
  429 + uni.openSetting({ // 打开设置页
  430 + success(res) {
  431 + console.log(res.authSetting, 88888)
  432 + }
  433 + });
  434 + } else { // 用户没有点击“总是保持以上,不再询问”则每次都会调起订阅消息
  435 + uni.requestSubscribeMessage({
  436 + tmplIds: ["XrIccvxDK3IfW3DrnLtKAtKS-pL63BrG3W0Du9l7BrU"], //
  437 + success(res) {
  438 + // 去订阅
  439 + that.dingyue()
  440 +
  441 + }
  442 + })
  443 + }
  444 + }
  445 + })
  446 + } else {
  447 + uni.showToast({
  448 + title: '请先登录',
  449 + icon: 'none'
  450 + })
  451 + setTimeout(function() {
  452 + uni.switchTab({
  453 + url: '/pages/mine/mine'
  454 + })
  455 + }, 1500)
  456 + }
  457 +
  458 + },
  459 + // 取消订阅
  460 + canceltixing(index,indexk, id) {
  461 + this.goods_id = id;
  462 + this.goodparindex = index;
  463 + this.goodindex=indexk;
  464 + this.dingyue()
  465 + },
  466 + // 订阅
  467 + dingyue() {
  468 + let that = this;
  469 + let url = "goods/addUserGoods";
  470 + let param = {
  471 + goods_id: that.goods_id
  472 + }
  473 + console.log('参数', param)
  474 + app.post(url, param, "post").then(r => {
  475 + console.log(r,that.goodparindex, that.goodindex, '订阅')
  476 + let newdingyuenum=that.dingyuenum;
  477 + if (that.beginlist[that.goodparindex].child[that.goodindex].user_goods == 0) {
  478 + that.beginlist[that.goodparindex].child[that.goodindex].user_goods= 1;
  479 + if(newdingyuenum.indexOf(that.beginlist[that.goodparindex].child[that.goodindex].id)==-1){
  480 + newdingyuenum.push(that.beginlist[that.goodparindex].child[that.goodindex].id)
  481 + }
  482 +
  483 + uni.showToast({
  484 + title: '订阅成功',
  485 + icon: "none"
  486 + })
  487 +
  488 + } else {
  489 + that.beginlist[that.goodparindex].child[that.goodindex].user_goods= 0;
  490 + newdingyuenum.forEach(function(value,index,array){
  491 + if(value==that.beginlist[that.goodparindex].child[that.goodindex].id){
  492 + newdingyuenum.splice(index,1)
  493 + }
  494 + })
  495 + uni.showToast({
  496 + title: '取消订阅成功',
  497 + icon: "none"
  498 + })
  499 + }
  500 + // 直播个数超过10个 显示false
  501 + that.beginlist.forEach(function(value,index,array){
  502 + value.child.forEach(function(valuek,indexk,arrayk){
  503 + if(newdingyuenum.length>=10){
  504 + if(valuek.user_goods ==0){
  505 + valuek.share=true
  506 + }
  507 + }else{
  508 + if(valuek.user_goods ==0){
  509 + valuek.share=false
  510 + }
  511 + }
  512 + })
  513 + })
  514 + that.beginlist = that.beginlist;
  515 + that.$forceUpdate();
  516 +
  517 + }).catch(err => {
  518 + console.log(err)
  519 + })
  520 + },
  521 +
  522 +
  523 + // 不再提醒
  524 + notibtn() {
  525 + this.noti = !this.noti;
  526 + if (this.noti == true) {
  527 + uni.setStorageSync("notixing", 1);
  528 + this.notixing=1
  529 + } else {
  530 + uni.setStorageSync("notixing", '');
  531 + this.notixing=''
  532 + }
  533 + },
  534 + // 我知道了
  535 + know() {
  536 + this.noshow = false
  537 + },
  538 + // 取消订阅
  539 + hideding() {
  540 + this.noshow = false
  541 + },
  542 + // 分享给好友
  543 + sharefriend(index,indexk,id,share) {
  544 + console.log(4398489)
  545 + let that = this;
  546 + if (uni.getStorageSync("token")) {
  547 + let notixing = uni.getStorageSync("notixing");
  548 + this.notixing = notixing;
  549 + if (that.notixing == '') {
  550 + that.noshow = true
  551 + } else {
  552 + that.noshow = false
  553 + }
  554 + that.goodindex = index;
  555 + that.goods_id = id;
  556 + that.share=share;
  557 + // that.dingyue()
  558 + wx.getSetting({
  559 + // withSubscriptions: true,//是否获取用户订阅消息的订阅状态,默认false不返回
  560 + success(res) {
  561 + if (res.authSetting['scope.subscribeMessage']) {
  562 + uni.openSetting({ // 打开设置页
  563 + success(res) {
  564 + console.log(res.authSetting, 88888)
  565 + }
  566 + });
  567 + } else { // 用户没有点击“总是保持以上,不再询问”则每次都会调起订阅消息
  568 + uni.requestSubscribeMessage({
  569 + tmplIds: ["XrIccvxDK3IfW3DrnLtKAtKS-pL63BrG3W0Du9l7BrU"], //
  570 + success(res) {
  571 + // 去订阅
  572 + that.dingyue()
  573 +
  574 + }
  575 + })
  576 + }
  577 + }
  578 + })
  579 + } else {
  580 + uni.showToast({
  581 + title: '请先登录',
  582 + icon: 'none'
  583 + })
  584 + setTimeout(function() {
  585 + uni.switchTab({
  586 + url: '/pages/mine/mine'
  587 + })
  588 + }, 1500)
  589 + }
  590 + },
  591 + // 进入直播详情
  592 + zhidetail(id){
  593 + uni.navigateTo({
  594 + url:"/pages/xinyuan/zhidetail?id="+id+'&zhiboid='+this.zhiboid
  595 + })
  596 + },
  597 + // 进入链接页面
  598 + entergood(item){
  599 + uni.navigateTo({
  600 + url:"/pages/xinyuan/goodlianjie?code="+item.code
  601 + })
  602 + },
  603 + searchenter(){
  604 + uni.navigateTo({
  605 + url:"/pages/xinyuan/search"
  606 + })
  607 + }
  608 +
  609 +
  610 +
  611 + }
  612 +
  613 + }
  614 +</script>
  615 +
  616 +<style>
  617 + @import url("../../style/xinyuan");
  618 + @import url("../../style/goodlist");
  619 +
  620 + page {
  621 + background: #f5f5f5;
  622 + }
  623 + .shareimg{
  624 + position: relative;
  625 + }
  626 +
  627 + .tailzhibo {
  628 + font-size: 28rpx
  629 + }
  630 +
  631 + .want {
  632 + margin-top: 0;
  633 + padding-top: 20rpx
  634 + }
  635 + .zhibotailtab{
  636 + position: relative;
  637 + }
  638 + .souimg{
  639 + width: 36rpx;
  640 + height: 36rpx;
  641 + position: absolute;
  642 + right: 86rpx;
  643 + bottom: 33rpx;
  644 +
  645 + }
  646 + .chahaoimg{
  647 + width:36rpx;
  648 + height: 36rpx;
  649 + margin-left:10rpx;
  650 + font-size: 0;
  651 +
  652 + }
  653 + .dongtai{
  654 + width:414rpx;
  655 + padding: 10rpx;
  656 + box-sizing: border-box;
  657 + border-radius: 10rpx;
  658 + border:1rpx solid #FF5D8E;
  659 + color:#FF5D8E;
  660 + font-size:28rpx;
  661 +
  662 + margin-top:20rpx;
  663 + display:flex;
  664 + align-items: center;
  665 + }
  666 +</style>
  1 +<template>
  2 + <view class="containerk">
  3 + <view class="searhtoppage flextwo">
  4 + <view class="searchtopk flextwo" @click='entersearch'>
  5 + <image src="../../static/search.png" mode="" class="search"></image>
  6 + <view class='searchleft'>
  7 + 输入您搜索的内容
  8 +
  9 + </view>
  10 +
  11 + </view>
  12 + <view class="cancelname">取消</view>
  13 + </view>
  14 + <view class="knowkind flexone">
  15 + <view class="knowkindleft">
  16 + <view class="knowkindleftitem" :class="selone==index?'knowkindactive':''" v-for="(item,index) in firstlist" :key="index"
  17 + @click="selkind(item.id,index)">{{item.name}}</view>
  18 +
  19 + </view>
  20 + <view class="knowkindright">
  21 + <view class="nodata" v-if="seclist.length==0">暂无数据</view>
  22 + <view v-else>
  23 + <view class="knowkindfightitem" v-for="(item,index) in seclist" :key="index">
  24 + <view class="knowtopbox flextwo">
  25 + <view class="knowtopname">{{item.name}}</view>
  26 + <view class="more flexone" @click="seemorekind(item.id)">
  27 + 查看所有美妆
  28 + <img src="../../static/yourow.png" alt="" class="yourow">
  29 + </view>
  30 + </view>
  31 + <view class="knowtoplist flexone">
  32 + <view class="knowtoplistitem" v-for="(itemk,indexk) in item.child" :key="indexk" @click="jumpsanji(item.id,itemk.id)">
  33 + <view class="knowtopimg">
  34 + <image :src="itemk.image" mode=""></image>
  35 + </view>
  36 + <view class="knowword">{{itemk.name}}</view>
  37 + </view>
  38 +
  39 + </view>
  40 + </view>
  41 +
  42 + </view>
  43 +
  44 + </view>
  45 + </view>
  46 + </view>
  47 +</template>
  48 +
  49 +<script>
  50 + import app from "../../App.vue";
  51 + import goodlist from "../../compontent/goodlist.vue";
  52 + import goodkind from "../../compontent/goodkind.vue";
  53 + export default {
  54 + components: {
  55 + goodlist,
  56 + goodkind
  57 + },
  58 + data() {
  59 + return {
  60 + firstlist: [],
  61 + cate_id: '', //一级分类id
  62 + seclist: [],
  63 + selone: 0,
  64 + id: "", //分类id
  65 + }
  66 + },
  67 + onLoad(options) {
  68 + this.getkind()
  69 + if (options.id) {
  70 + this.id = options.id //分类id
  71 + }
  72 +
  73 + },
  74 + methods: {
  75 + // 获取分类 一级
  76 + getkind() {
  77 + let that = this;
  78 + var url = "category/getCategoryOne"
  79 + let param = {
  80 +
  81 + }
  82 + app.post(url, param, "post").then(res => {
  83 + console.log('我想要的', res)
  84 + that.firstlist = res;
  85 + if (that.id != '') {
  86 + that.firstlist.forEach(function(value, index,array) {
  87 + if (value.id == that.id) {
  88 + that.cate_id = value.id;
  89 + that.selone=index
  90 + }
  91 + })
  92 + } else {
  93 + that.cate_id = res[0].id
  94 + }
  95 +
  96 +
  97 + that.getseclist()
  98 +
  99 + }).catch(err => {
  100 + console.log(err)
  101 + })
  102 + },
  103 + selkind(id, index) {
  104 + this.cate_id = id;
  105 + this.seclist = [];
  106 + this.selone = index;
  107 + this.getseclist()
  108 + },
  109 + // 获取二级分类
  110 + getseclist() {
  111 + let that = this;
  112 + var url = "category/getCategory"
  113 + let param = {
  114 + cate_id: that.cate_id
  115 + }
  116 + app.post(url, param, "post").then(res => {
  117 + console.log('我想要的', res)
  118 + that.seclist = res;
  119 +
  120 +
  121 + }).catch(err => {
  122 + console.log(err)
  123 + })
  124 + },
  125 + // 跳转三级分类
  126 + jumpsanji(erid, sanid) {
  127 + uni.navigateTo({
  128 + url: "/pages/xinyuan/sanjikind?id=" + this.cate_id + '&secid=' + erid + '&sanid=' + sanid //cate_id 一级分类id id 二级分类id
  129 + })
  130 + },
  131 +
  132 + // 查看更多跳转二级分类
  133 + seemorekind(id) {
  134 + if (this.cate_id == 0) {
  135 + uni.navigateTo({
  136 + url: "/pages/xinyuan/erjikind?id=" + id + '&type=' + 1 //一级分类id
  137 + })
  138 + } else {
  139 + if (id == 0) {
  140 + uni.navigateTo({
  141 + url: "/pages/xinyuan/erjikind?id=" + this.cate_id + '&type=' + 1 //一级分类id
  142 + })
  143 + } else {
  144 + uni.navigateTo({
  145 + url: "/pages/xinyuan/erjikind?id=" + id + '&type=' + 2 //二级分类id
  146 + })
  147 + }
  148 + }
  149 +
  150 + },
  151 + // 进入搜索页面
  152 + entersearch() {
  153 + uni.navigateTo({
  154 + url: '/pages/xinyuan/search'
  155 + })
  156 + },
  157 +
  158 + }
  159 +
  160 + }
  161 +</script>
  162 +
  163 +<style>
  164 + @import url("../../style/xinyuan");
  165 +
  166 + .containerk {
  167 + padding: 32rpx 28rpx;
  168 + box-sizing: border-box;
  169 + }
  170 +
  171 + .searhtoppage {
  172 + padding: 0 32rpx;
  173 + box-sizing: border-box;
  174 + }
  175 +</style>
  1 +<template>
  2 + <view class="container">
  3 + <view class="zhibotopbox">
  4 + <view class="zhibotaltop flexone">
  5 + <view class="zhibohead">
  6 + <image :src="info.avatar" mode=""></image>
  7 + </view>
  8 + <view class="zhiboright">
  9 + <view class="zhubotail flextwo">
  10 + <view class="tailrighttop flexone">
  11 + <view class="tailname">{{info.name}}</view>
  12 + <view class="taillabel">{{info.platform}}</view>
  13 + </view>
  14 + <view class="shareimg">
  15 + <image src="../../static/share.png" mode="" class="sharebtn"></image>
  16 + <button open-type="share" class="shartype"></button>
  17 + </view>
  18 + </view>
  19 +
  20 + <view class='tailrightbot flexone'>
  21 + <view class="tailzhibo" v-if="info.user_anchor==0" @click="dingyuezhi">订阅直播</view>
  22 + <view class="tailzhibo" v-if="info.user_anchor==1" @click="dingyuezhi">取消订阅</view>
  23 + <view class='taildate' v-if="info.anchor_time!=null">{{info.anchor_time.time}}开播</view>
  24 + </view>
  25 +
  26 + </view>
  27 + </view>
  28 + <view class="zhibonametext" v-if="info.anchor_time!=null">{{info.anchor_time.title}}</view>
  29 + </view>
  30 + <!-- 主播种类 -->
  31 + <view class="zhubokind flextwo">
  32 + <view class="zhubokinditem">
  33 + <view class="zhuboimg">
  34 + <image src="../../static/yulan.png" mode=""></image>
  35 + <view class='yuanquan'></view>
  36 + </view>
  37 +
  38 + <view class="zhubokindname">浏览预告</view>
  39 + <view class="setname">设置商品提醒</view>
  40 +
  41 + </view>
  42 + <view class="zhubokinditem">
  43 + <view class="zhuboimg">
  44 + <image src="../../static/intro.png" mode=""></image>
  45 + <view class='yuanquan'></view>
  46 + </view>
  47 + <view class="zhubokindname">主播介绍</view>
  48 + <view class="setname">立刻推送提醒</view>
  49 + </view>
  50 + <view class="zhubokinditem">
  51 + <view class="zhuboimg">
  52 + <image src="../../static/tixing.png" mode=""></image>
  53 + <view class='yuanquan'></view>
  54 + </view>
  55 +
  56 + <view class="zhubokindname">收到提醒</view>
  57 + <view class="setname">打开软件购买</view>
  58 +
  59 + </view>
  60 + </view>
  61 + <!-- 即将开始 -->
  62 + <!-- v-if="info.button==true" -->
  63 + <view v-if="beginlist.length!=0">
  64 + <view v-for="(item,index) in beginlist" :key="index" style="padding: 0 32rpx;box-sizing: border-box;">
  65 + <view class="want flextwo">
  66 + <view class="wantleft flexone">
  67 + <image src="../../static/meizhuanglei.png" mode="" class="likeimg"></image>
  68 + {{item.name}}
  69 + </view>
  70 + <!-- <view class="more flexone">
  71 + 更多
  72 + <img src="../../static/yourow.png" alt="" class="yourow">
  73 + </view> -->
  74 + </view>
  75 + <view class="goodlist">
  76 + <view class="goodlistitem flex" v-for="(itemk,indexk) in item.child" :key="indexk" @click="entergood(item)">
  77 + <view class="goodlistimg">
  78 + <image src="../static/goodlistimg.png" mode=""></image>
  79 + </view>
  80 + <view class="goodlistright">
  81 + <view class="goodrighttop flextwo">
  82 + <view class="goodname">{{itemk.name}}</view>
  83 + <view class="shareimg">
  84 + <image src="../../static/share.png" mode="" class="sharebtn"></image>
  85 + <button open-type="share" class="shartype"></button>
  86 + </view>
  87 + </view>
  88 + <view class="zhibo flextwo">
  89 + <view class="zhiboleft">{{itemk.anchor.name}}{{itemk.anchor.platform}}</view>
  90 + <view class="kaibo">{{itemk.anchor_time.time}}开播</view>
  91 + </view>
  92 + <view class="zhiboprice">
  93 + 直播价 ¥<text class="pricege">{{itemk.live_price}}</text>
  94 + </view>
  95 + <view class="cankao flextwo">
  96 + <view class="cankaoleft">参考价(京东¥{{itemk.r_price}}元)</view>
  97 + <view v-if='itemk.status_data==1'>
  98 + <view v-if="itemk.user_goods==0">
  99 + <view class="canlaoright flexone" v-if="itemk.share==true" >
  100 + <image src="../../static/naoling.png" mode="" class="naoling"></image>
  101 + 提醒我
  102 + <button open-type="share" class="sharebtnk" v-if="notixing==1" @click.stop="sharefriend(index,indexk,itemk.id,item.share)"></button>
  103 + </view>
  104 + <view class="canlaoright flexone" v-else @click.stop="tixing(index,indexk,itemk.id)">
  105 + <image src="../../static/naoling.png" mode="" class="naoling"></image>
  106 + 提醒我
  107 + </view>
  108 +
  109 + </view>
  110 + <view class="canceltixing" v-else @click.stop="canceltixing(index,indexk,itemk.id)">
  111 + 取消提醒
  112 + </view>
  113 + </view>
  114 + <view v-if="itemk.status_data==2">
  115 + <view class="canlaoright flexone">
  116 +
  117 + 已上架
  118 + </view>
  119 + </view>
  120 +
  121 + </view>
  122 + </view>
  123 + </view>
  124 +
  125 + </view>
  126 +
  127 + </view>
  128 + </view>
  129 + <view style="padding: 32rpx;box-sizing: border-box;">
  130 + <!-- 这里也有你想要的 -->
  131 + <view class="want flextwo">
  132 + <view class="wantleft flexone">
  133 + <image src="../../static/like.png" mode="" class="likeimg"></image>
  134 + 也许这里也又你想要的
  135 + </view>
  136 + </view>
  137 + <goodkind :wantlist="wantlist"></goodkind>
  138 + </view>
  139 + <!-- 弹出层 -->
  140 + <view class="register" v-if="noshow" @click="hideding">
  141 + <view class="registerwrap">
  142 + <view class="title">何时提醒我?</view>
  143 + <view class="titletext">在主播开始介绍商品时就提醒您</view>
  144 + <view class="title">如何提醒我</view>
  145 + <view class="titletext">在你允许消息通知后,届时会给您发送微信消息提醒</view>
  146 + <view class='noti flexone' @click="notibtn">
  147 + <image src="../static/selectzhong.png" mode="" class="selectxuan" v-if="noti"></image>
  148 + <image src="../static/select.png" mode="" class="selectxuan" v-else></image>
  149 +
  150 + 不再提示
  151 + </view>
  152 + <button class="buzai" @click.stop="know" v-if="share==true" open-type="share">我知道了</button>
  153 + <view class="buzai" @click.stop="know" v-else>我知道了</view>
  154 + </view>
  155 + </view>
  156 +
  157 + </view>
  158 +</template>
  159 +
  160 +<script>
  161 + import app from "../../App.vue";
  162 + import goodlist from "../../compontent/goodlist.vue"
  163 + import goodkind from "../../compontent/goodkind.vue"
  164 + import {Toast} from "../../utils/toast.js"
  165 + var that
  166 + export default {
  167 + components: {
  168 + goodlist,
  169 + goodkind
  170 + },
  171 + data() {
  172 + return {
  173 + begin: 1,
  174 + hasgood: false,
  175 + zhiboid: "",
  176 + info: '',
  177 + sel: '',
  178 + beginlist:[],
  179 + page:1,
  180 + wantlist:[],
  181 + hislist:[],
  182 + showpull:true,
  183 + notixing:'',
  184 + goods_id: '',
  185 + noti: false, //提示和不提示按钮
  186 + noshow: false, //提示我弹出层
  187 +
  188 + goodindex: '',
  189 + goodparindex:'',
  190 + share:'',
  191 + anchor_time_id:"",
  192 + dingyuenum:[]
  193 + }
  194 + },
  195 + onLoad(options) {
  196 + this.zhiboid = options.zhiboid;
  197 + this.anchor_time_id=options.id
  198 + // 获取主播详情
  199 + this.getzhibodetail();
  200 + this.getbeginlist();
  201 + // 获取想要的
  202 + this.getwant()
  203 +
  204 +
  205 + },
  206 + onShow() {
  207 + let notixing = uni.getStorageSync("notixing");
  208 + this.notixing = notixing;
  209 + },
  210 + onShareAppMessage(res) {
  211 + let that = this;
  212 + if (res.from === 'button') { // 来自页面内分享按钮
  213 + console.log(res.target)
  214 + }
  215 + return {
  216 + title: '早直播',
  217 + path:'/pages/xinyuan/zhibodetail?id='+this.zhiboid
  218 + }
  219 + },
  220 + onReachBottom() {
  221 + that=this
  222 + let newpage=that.page;
  223 + newpage++
  224 + that.page=newpage;
  225 + if(that.showpull==true){
  226 + console.log(38493409)
  227 + Toast('没有更多了~')
  228 + }else{
  229 + if(this.begin==1){
  230 + that.getbeginlist()
  231 + }else{
  232 + this.gethislist()
  233 + }
  234 +
  235 + }
  236 + },
  237 + methods: {
  238 + // 直播详情
  239 + getzhibodetail() {
  240 + let that = this;
  241 + var url = "anchor/getAnchorInfo"
  242 + let param = {
  243 + anchor_id: that.zhiboid
  244 + }
  245 + app.post(url, param, "post").then(res => {
  246 + console.log('主播详情', res)
  247 + that.info=res
  248 +
  249 + }).catch(err => {
  250 + console.log(err)
  251 + })
  252 + },
  253 + // 查看更多
  254 + seemore() {
  255 + uni.navigateTo({
  256 + url: "/pages/xinyuan/zhiboknow"
  257 + })
  258 + },
  259 + beginstart(id) {
  260 + this.begin = id;
  261 + this.page=1;
  262 + this.beginlist=[];
  263 + this.hislist=[]
  264 + if(id==1){
  265 + this.getbeginlist()
  266 + }else{
  267 + this.gethislist()
  268 + }
  269 + },
  270 + // 全部 今天 明天
  271 + select(id) {
  272 + this.sel = id;
  273 + this.page=1;
  274 + this.beginlist=[];
  275 + this.getbeginlist()
  276 + },
  277 +
  278 + // 订阅直播
  279 + dingyuezhi(){
  280 + console.log(9999)
  281 + let that = this;
  282 + var url = "anchor/addUserAnchor"
  283 + let param = {
  284 + anchor_id: that.zhiboid
  285 + }
  286 + app.post(url, param, "post").then(res => {
  287 + console.log('主播订阅', res)
  288 + if(that.info.user_anchor==0){
  289 + that.info.user_anchor=1;
  290 + uni.showToast({
  291 + title:'订阅成功',
  292 + icon:'none'
  293 +
  294 + })
  295 + }else{
  296 + that.info.user_anchor=0;
  297 + uni.showToast({
  298 + title:'取消订阅成功',
  299 + icon:'none'
  300 +
  301 + })
  302 + }
  303 + that.info=that.info;
  304 + that.$forceUpdate()
  305 +
  306 +
  307 + }).catch(err => {
  308 + console.log(err)
  309 + })
  310 + },
  311 +
  312 + // 获取即将开播
  313 + getbeginlist() {
  314 + let that = this;
  315 + var url = "anchor/getAnchorTimeGoods"
  316 + let param = {
  317 + anchor_time_id: that.anchor_time_id,
  318 + page: that.page,
  319 + per_page: 20
  320 + }
  321 + app.post(url, param, "post").then(res => {
  322 + console.log('即将开播', res)
  323 + that.beginlist=that.beginlist.concat(res)
  324 + if(that.page>1){
  325 + if(res.data.length==0){
  326 + that.showpull=false
  327 + }
  328 + }
  329 + that.beginlist.forEach(function(value,index,array){
  330 + value.child.forEach(function(valuek,indexk,arrayk){
  331 + if(valuek.user_goods==1){
  332 + if(that.dingyuenum.indexOf(valuek.id)==-1){
  333 + that.dingyuenum.push(valuek.id);
  334 + that.dingyuenum=that.dingyuenum
  335 + }
  336 + }
  337 + })
  338 +
  339 + })
  340 + }).catch(err => {
  341 + console.log(err)
  342 + })
  343 + },
  344 +
  345 + // 你想要的
  346 + getwant(){
  347 + let that = this;
  348 + var url = "category/getRandCategory"
  349 + let param={
  350 + limit:8
  351 + }
  352 + app.post(url, param, "post").then(res => {
  353 + console.log('我想要的', res)
  354 + that.wantlist=res
  355 +
  356 +
  357 + }).catch(err => {
  358 + console.log(err)
  359 + })
  360 + },
  361 +
  362 + // 订阅消息
  363 + tixing(index,indexk,id) {
  364 + console.log(99)
  365 + let that = this;
  366 + if (uni.getStorageSync("token")) {
  367 + if (that.notixing == '') {
  368 + that.noshow = true
  369 + } else {
  370 + that.noshow = false
  371 + }
  372 + that.goodindex = indexk;
  373 + that.goodparindex=index;
  374 + this.goods_id = id;
  375 + // this.dingyue()
  376 + wx.getSetting({
  377 + // withSubscriptions: true,//是否获取用户订阅消息的订阅状态,默认false不返回
  378 + success(res) {
  379 + if (res.authSetting['scope.subscribeMessage']) {
  380 + uni.openSetting({ // 打开设置页
  381 + success(res) {
  382 + console.log(res.authSetting, 88888)
  383 + }
  384 + });
  385 + } else { // 用户没有点击“总是保持以上,不再询问”则每次都会调起订阅消息
  386 + uni.requestSubscribeMessage({
  387 + tmplIds: ["XrIccvxDK3IfW3DrnLtKAtKS-pL63BrG3W0Du9l7BrU"], //
  388 + success(res) {
  389 + // 去订阅
  390 + that.dingyue()
  391 +
  392 + }
  393 + })
  394 + }
  395 + }
  396 + })
  397 + } else {
  398 + uni.showToast({
  399 + title: '请先登录',
  400 + icon: 'none'
  401 + })
  402 + setTimeout(function() {
  403 + uni.switchTab({
  404 + url: '/pages/mine/mine'
  405 + })
  406 + }, 1500)
  407 + }
  408 +
  409 + },
  410 + // 取消订阅
  411 + canceltixing(index,indexk, id) {
  412 + this.goods_id = id;
  413 + this.goodindex = index;
  414 + this.goodparindex=indexk;
  415 + this.dingyue()
  416 + },
  417 + // 订阅
  418 + dingyue() {
  419 + let that = this;
  420 + let url = "goods/addUserGoods";
  421 + let param = {
  422 + goods_id: that.goods_id
  423 + }
  424 + console.log('参数', param)
  425 + app.post(url, param, "post").then(r => {
  426 + console.log(r, that.goodindex, '订阅')
  427 + let newdingyuenum=that.dingyuenum;
  428 + if (that.beginlist[that.goodparindex].child[that.goodindex].user_goods == 0) {
  429 + that.beginlist[that.goodparindex].child[that.goodindex].user_goods= 1;
  430 + if(newdingyuenum.indexOf(that.beginlist[that.goodparindex].child[that.goodindex].id)==-1){
  431 + newdingyuenum.push(that.beginlist[that.goodparindex].child[that.goodindex].id)
  432 + }
  433 + uni.showToast({
  434 + title: '订阅成功',
  435 + icon: "none"
  436 + })
  437 +
  438 + } else {
  439 + that.beginlist[that.goodparindex].child[that.goodindex].user_goods= 0;
  440 + newdingyuenum.forEach(function(value,index,array){
  441 + if(value==that.beginlist[that.goodparindex].child[that.goodindex].id){
  442 + newdingyuenum.splice(index,1)
  443 + }
  444 + })
  445 + uni.showToast({
  446 + title: '取消订阅成功',
  447 + icon: "none"
  448 + })
  449 + }
  450 + // 直播个数超过10个 显示false
  451 + that.beginlist.forEach(function(value,index,array){
  452 + value.child.forEach(function(valuek,indexk,arrayk){
  453 + if(newdingyuenum.length>=10){
  454 + if(valuek.user_goods ==0){
  455 + valuek.share=true
  456 + }
  457 + }else{
  458 + if(valuek.user_goods ==0){
  459 + valuek.share=false
  460 + }
  461 + }
  462 + })
  463 + })
  464 + that.beginlist = that.beginlist;
  465 + that.$forceUpdate();
  466 +
  467 + }).catch(err => {
  468 + console.log(err)
  469 + })
  470 + },
  471 + // 不再提醒
  472 + notibtn() {
  473 + this.noti = !this.noti;
  474 + if (this.noti == true) {
  475 + uni.setStorageSync("notixing", 1);
  476 + this.notixing=1;
  477 + } else {
  478 + uni.setStorageSync("notixing", '');
  479 + this.notixing=''
  480 + }
  481 + },
  482 + // 我知道了
  483 + know() {
  484 + this.noshow = false
  485 + },
  486 + // 取消订阅
  487 + hideding() {
  488 + this.noshow = false
  489 + },
  490 + // 分享给好友
  491 + sharefriend(index,indexk,id,share) {
  492 + console.log(4398489)
  493 + let that = this;
  494 + if (uni.getStorageSync("token")) {
  495 + let notixing = uni.getStorageSync("notixing");
  496 + this.notixing = notixing;
  497 + if (that.notixing == '') {
  498 + that.noshow = true
  499 + } else {
  500 + that.noshow = false
  501 + }
  502 + that.goodindex = index;
  503 + that.goods_id = id;
  504 + that.share=share;
  505 + wx.getSetting({
  506 + // withSubscriptions: true,//是否获取用户订阅消息的订阅状态,默认false不返回
  507 + success(res) {
  508 + if (res.authSetting['scope.subscribeMessage']) {
  509 + uni.openSetting({ // 打开设置页
  510 + success(res) {
  511 + console.log(res.authSetting, 88888)
  512 + }
  513 + });
  514 + } else { // 用户没有点击“总是保持以上,不再询问”则每次都会调起订阅消息
  515 + uni.requestSubscribeMessage({
  516 + tmplIds: ["XrIccvxDK3IfW3DrnLtKAtKS-pL63BrG3W0Du9l7BrU"], //
  517 + success(res) {
  518 + // 去订阅
  519 + that.dingyue()
  520 +
  521 + }
  522 + })
  523 + }
  524 + }
  525 + })
  526 + } else {
  527 + uni.showToast({
  528 + title: '请先登录',
  529 + icon: 'none'
  530 + })
  531 + setTimeout(function() {
  532 + uni.switchTab({
  533 + url: '/pages/mine/mine'
  534 + })
  535 + }, 1500)
  536 + }
  537 + },
  538 + // 进入链接页面
  539 + entergood(item){
  540 + uni.navigateTo({
  541 + url:"/pages/xinyuan/goodlianjie?code="+item.code
  542 + })
  543 + }
  544 + }
  545 +
  546 + }
  547 +</script>
  548 +
  549 +<style>
  550 + @import url("../../style/xinyuan");
  551 + @import url("../../style/goodlist");
  552 +
  553 + page {
  554 + background:#fff;
  555 + }
  556 + .shareimg{
  557 + position: relative;
  558 + }
  559 +
  560 + .tailzhibo {
  561 + font-size: 28rpx
  562 + }
  563 +
  564 + .want {
  565 + margin-top: 0;
  566 + padding-top: 20rpx
  567 + }
  568 + .zhubokind {
  569 + background: #fff;
  570 + }
  571 +</style>
  1 +<template>
  2 + <view class="container">
  3 + <view class="searhtoppage flextwo">
  4 + <view class="searchtopk flextwo" @click="search">
  5 + <image src="../../static/search.png" mode="" class="search"></image>
  6 + <view class='searchleft'>
  7 + 输入您搜索的内容
  8 + <!-- <input type="text" placeholder="输入您搜索的内容" /> -->
  9 + </view>
  10 +
  11 + </view>
  12 + <view class="cancelname">取消</view>
  13 + </view>
  14 + <view class="swiper_image">
  15 + <swiper :indicator-dots="indicatorDots" :autoplay="autoplay" :interval="interval" :duration="duration" class="swiper_item_img" @change="swiperChange" :circular="true"
  16 + >
  17 + <swiper-item v-for="(item,index) in imgUrls" :key="index">
  18 + <image :src="item" class="slide-image" mode="aspectFill"/>
  19 + </swiper-item>
  20 +
  21 + </swiper>
  22 + <view class="dots">
  23 + <block v-for="(item,index) in imgUrls" :key="index">
  24 + <view class="dot" :class="index == currentSwiper ? ' active' : ''" data-index="index"></view>
  25 + </block>
  26 + </view>
  27 +
  28 + </view>
  29 +
  30 + <!-- 主播种类 -->
  31 + <view class="zhubokind flextwo">
  32 + <view class="zhubokinditem">
  33 + <view class="zhuboimg">
  34 + <image src="../../static/yulan.png" mode=""></image>
  35 + <view class='yuanquan'></view>
  36 + </view>
  37 +
  38 + <view class="zhubokindname">浏览预告</view>
  39 + <view class="setname">设置商品提醒</view>
  40 +
  41 + </view>
  42 + <view class="zhubokinditem">
  43 + <view class="zhuboimg">
  44 + <image src="../../static/intro.png" mode=""></image>
  45 + <view class='yuanquan'></view>
  46 + </view>
  47 + <view class="zhubokindname">主播介绍</view>
  48 + <view class="setname">立刻推送提醒</view>
  49 + </view>
  50 + <view class="zhubokinditem">
  51 + <view class="zhuboimg">
  52 + <image src="../../static/tixing.png" mode=""></image>
  53 + <view class='yuanquan'></view>
  54 + </view>
  55 +
  56 + <view class="zhubokindname">收到提醒</view>
  57 + <view class="setname">打开软件购买</view>
  58 +
  59 + </view>
  60 + </view>
  61 + <!-- 主播列表 -->
  62 + <view class="zhubolist">
  63 +
  64 + <view class="zhubolistitem flexone" v-for="(item,index) in zhubolist" :key="index" @click="zhubodetail(item.id)">
  65 + <view class="zhubohead">
  66 + <image :src="item.avatar" mode=""></image>
  67 + <view class="zhuboname" >{{item.name}}</view>
  68 + </view>
  69 + <view class="zhubonamebox">
  70 + <view class="zhubonametop flextwo">
  71 + <view class="zhubomingzi">最近一场</view>
  72 + <view class="zhubodate" v-if="item.anchor_time==null">时间待定</view>
  73 + <view class="zhubodate" v-else>{{item.anchor_time.time}}开播</view>
  74 + </view>
  75 + <view class="zhubotext" v-if="item.anchor_time==null">戳详情订阅TA预告提醒</view>
  76 + <view class="zhubotext" v-else>{{item.anchor_time.title}}</view>
  77 + <view class="seemore">查看与{{item.name}}有关的一切></view>
  78 + </view>
  79 + </view>
  80 + </view>
  81 + </view>
  82 +</template>
  83 +
  84 +<script>
  85 + import app from "../../App.vue";
  86 + import {Toast} from "../../utils/toast.js";
  87 + var that;
  88 + export default {
  89 + data() {
  90 + return {
  91 + index: 0,
  92 + indicatorDots: false,
  93 + autoplay: true,
  94 + interval: 3000,
  95 + duration: 500,
  96 + currentSwiper: 0,
  97 + imgUrls:["1","2"],
  98 + page:1,
  99 + zhubolist:[],
  100 + showpull:true,
  101 + }
  102 + },
  103 + onLoad() {
  104 + // 获取主播列表
  105 + this.getzhubolist();
  106 + // 获取主播banner
  107 + this.getbanner()
  108 + },
  109 + onReachBottom() {
  110 + that=this
  111 + let newpage=that.page;
  112 + newpage++
  113 + that.page=newpage;
  114 + if(that.showpull==true){
  115 + console.log(38493409)
  116 + Toast('没有更多了~')
  117 + }else{
  118 + that.getzhubolist()
  119 + }
  120 + },
  121 + methods: {
  122 + swiperChange: function(e) {
  123 + this.currentSwiper = e.detail.current
  124 + },
  125 + // 进入搜索页面
  126 + search() {
  127 + uni.navigateTo({
  128 + url: '/pages/xinyuan/search'
  129 + })
  130 + },
  131 + // 获取banner图
  132 + getbanner(){
  133 + let that = this;
  134 + var url = "anchor/getBanner"
  135 + let param={
  136 +
  137 + }
  138 + app.post(url, param, "post").then(res => {
  139 + console.log('主播banner', res)
  140 + that.imgUrls=res;
  141 +
  142 + }).catch(err => {
  143 + console.log(err)
  144 + })
  145 + },
  146 + // 获取主播列表
  147 + getzhubolist(){
  148 + let that = this;
  149 + var url = "anchor/getAnchor"
  150 + let param={
  151 + page:that.page,
  152 + per_apge:10
  153 + }
  154 + app.post(url, param, "post").then(res => {
  155 + console.log('主播列表', res)
  156 + that.zhubolist=that.zhubolist.concat(res.data);
  157 + if(that.page>1){
  158 + if(res.data.length==0){
  159 + that.showpull=false
  160 + }
  161 + }
  162 +
  163 +
  164 + }).catch(err => {
  165 + console.log(err)
  166 + })
  167 + },
  168 + // 主播详情
  169 + zhubodetail(id){
  170 + uni.navigateTo({
  171 + url:'/pages/xinyuan/zhibodetail?id='+id
  172 + })
  173 + }
  174 +
  175 + }
  176 +
  177 + }
  178 +</script>
  179 +
  180 +<style>
  181 + @import url("../../style/xinyuan");
  182 + .searhtoppage{
  183 + padding: 0 32rpx;
  184 + box-sizing: border-box;
  185 + }
  186 + /* 轮播图 */
  187 + .swiper_image {
  188 + width: 688rpx;
  189 + height: 256rpx;
  190 + font-size: 0;
  191 + margin: 80rpx auto 0;
  192 + position: relative;
  193 + border-radius: 5rpx;
  194 + }
  195 +
  196 + swiper {
  197 + width: 688rpx;
  198 + height: 256rpx;
  199 + border-radius: 10rpx;
  200 + }
  201 +
  202 + .swiper_image image {
  203 + width: 100%;
  204 + height: 100%;
  205 + border-radius: 20rpx;
  206 + }
  207 +
  208 + .swiper_item_img swiper-item {
  209 + width: 688rpx;
  210 + height: 256rpx;
  211 + border-radius: 10rpx;
  212 + }
  213 +
  214 + .swiper_item_img swiper-item image {
  215 + width: 100%;
  216 + height: 100%;
  217 + border-radius: 10rpx;
  218 + }
  219 +
  220 + swiper-item {
  221 + position: relative;
  222 + }
  223 +
  224 + swiper-item image {
  225 + border-radius: 10rpx;
  226 + }
  227 +
  228 + .picimg {
  229 + width: 156rpx;
  230 + height: 76rpx;
  231 + position: absolute;
  232 + right: 36rpx;
  233 + bottom: 30rpx;
  234 + }
  235 +
  236 + .dots {
  237 + height: 36rpx;
  238 + display: flex;
  239 + flex-direction: row;
  240 + position: absolute;
  241 + left: 50%;
  242 + transform: translateX(-50%);
  243 + bottom: 10rpx;
  244 + }
  245 +
  246 + /*未选中时的小圆点样式 */
  247 +
  248 + .dot {
  249 + width: 14rpx;
  250 + height: 14rpx;
  251 + border-radius: 50%;
  252 + margin-right: 16rpx;
  253 + background-color: #b9c0f7;
  254 + }
  255 +
  256 + /*选中以后的小圆点样式 */
  257 +
  258 + .active {
  259 + width: 16rpx;
  260 + height: 16rpx;
  261 + border-radius: 50%;
  262 + background-color: #fff;
  263 + }
  264 +
  265 +</style>

832 字节

  1 +.goodkind{
  2 + flex-wrap: wrap;
  3 + margin-top:40rpx
  4 +}
  5 +.goodkinditem{
  6 + display:flex;
  7 + flex-direction: column;
  8 + align-items: center;
  9 + justify-content: center;
  10 + margin-right:108rpx;
  11 + margin-bottom:20rpx
  12 +
  13 +}
  14 +.goodkindimg{
  15 + width:80rpx;
  16 + height: 80rpx;
  17 +}
  18 +.wantname{
  19 + color:#161616;
  20 + font-size: 22rpx;
  21 + margin-top:16rpx;
  22 + text-align: center;
  23 +}
  24 +.goodkinditem:nth-child(4n){
  25 + margin-right: 0;
  26 +}
  1 +.goodlist{
  2 + margin-top:54rpx
  3 +}
  4 +
  5 +.goodlistimg{
  6 + width:149rpx;
  7 + height: 160rpx;
  8 + margin-right:55rpx
  9 +}
  10 +.shareimg{
  11 + width: 48rpx;
  12 + height: 48rpx;
  13 + background: #ffffff;
  14 + border-radius: 24rpx;
  15 + box-shadow: 0px 0px 12rpx 0px rgba(126,7,7,0.16);
  16 + display:flex;
  17 + align-items: center;
  18 + justify-content: center;
  19 + position: relative;
  20 +}
  21 +.shartype{
  22 + width: 48rpx;
  23 + height: 48rpx;
  24 + position: absolute;
  25 + top:0;
  26 + left:0;
  27 + border:none;
  28 + outline: none;
  29 + background:transparent;
  30 +}
  31 +.shartype::after{
  32 + border:none;
  33 + outline: none;
  34 + background:transparent;
  35 +}
  36 +.goodlistright{
  37 + flex:1
  38 +}
  39 +.goodname{
  40 + color:#0F0F0F;
  41 + font-size: 30rpx;
  42 + font-weight: bold;
  43 + width:336rpx;
  44 + overflow: hidden;
  45 + text-overflow: ellipsis;
  46 + white-space: nowrap;
  47 +}
  48 +.sharebtn{
  49 + width:28rpx;
  50 + height: 28rpx;
  51 +}
  52 +.goodlistitem{
  53 + padding: 18rpx 0rpx;
  54 + box-sizing: border-box;
  55 + border-bottom:1rpx solid #F5F5F5
  56 +}
  57 +.zhibo{
  58 + flex:1;
  59 + margin-top:10rpx
  60 +}
  61 +.zhiboleft{
  62 + padding:2rpx 8rpx;
  63 + box-sizing: border-box;
  64 + background: #ffffff;
  65 + border: 2px solid #ffb974;
  66 + border-radius: 4rpx;
  67 + color:#FFB974;
  68 + font-size:20rpx
  69 +}
  70 +.kaibo{
  71 + color:#A0A0A0;
  72 + font-size:22rpx
  73 +}
  74 +.zhiboprice{
  75 + color:#FF0000;
  76 + font-size:22rpx;
  77 + margin-top:38rpx
  78 +}
  79 +.pricege{
  80 + color:#FF0000;
  81 + font-size:30rpx;
  82 + font-weight: bold;
  83 +}
  84 +.canlaoright{
  85 + width: 144rpx;
  86 + height: 48rpx;
  87 + background: linear-gradient(85deg,#ff5d8e 8%, #ff8172 97%);
  88 + border-radius: 10rpx;
  89 + color:#fff;
  90 + font-size: 24rpx;
  91 + display:flex;
  92 + justify-content: center;
  93 + align-items: center;
  94 + position: relative;
  95 +}
  96 +.sharebtnk{
  97 + width: 144rpx;
  98 + height: 48rpx;
  99 + position: absolute;
  100 + left:0;
  101 + top:0
  102 +}
  103 +.canceltixing{
  104 + width: 144rpx;
  105 + height: 48rpx;
  106 + background: #bbbbbb;
  107 + border-radius: 10rpx;
  108 + color:#fff;
  109 + font-size:24rpx;
  110 + text-align:center;
  111 + line-height: 48rpx;
  112 +}
  113 +.cankao{
  114 + margin-top:12rpx
  115 +}
  116 +.cankaoleft{
  117 + color:#999999;
  118 + font-size:22rpx
  119 +}
  120 +.naoling{
  121 + width:22rpx;
  122 + height: 22rpx;
  123 + margin-right:10rpx
  124 +}
  125 +.wantleft{
  126 +
  127 +}
  128 +.likeimg{
  129 + width:32rpx;
  130 + height: 32rpx;
  131 + margin-right: 16rpx;
  132 +}
  133 +button{
  134 + border:none;
  135 + outline: none;
  136 + background: transparent;
  137 +}
  138 +button::after{
  139 + border:none;
  140 + outline: none;
  141 +}
  142 +.registerwrap {
  143 + width: 560rpx;
  144 + height: 620rpx;
  145 + background: #fff;
  146 + border-radius: 20rpx;
  147 + position: absolute;
  148 + top: 50%;
  149 + left: 50%;
  150 + transform: translate(-50%, -50%);
  151 + padding: 42rpx 32rpx 32rpx;
  152 + box-sizing: border-box;
  153 + }
  154 +
  155 + .title {
  156 + color: #333;
  157 + font-size: 32rpx;
  158 + font-weight: bold;
  159 + text-align: center;
  160 + margin-bottom: 40rpx
  161 + }
  162 +
  163 + .titletext {
  164 + color: #333;
  165 + font-size: 28rpx;
  166 + margin-bottom: 40rpx;
  167 + }
  168 +
  169 + .selectxuan {
  170 + width: 30rpx;
  171 + height: 30rpx;
  172 + margin-right: 20rpx;
  173 + }
  174 +
  175 + .noti {
  176 + color: #333;
  177 + font-size: 28rpx
  178 + }
  179 +
  180 + .buzai {
  181 + width: 368rpx;
  182 + height: 64rpx;
  183 + background: #ff5d8e;
  184 + border-radius: 32rpx;
  185 + color: #fff;
  186 + font-size: 28rpx;
  187 + text-align: center;
  188 + line-height: 64rpx;
  189 + margin: 40rpx auto 0;
  190 + }