index.vue 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340
  1. <template>
  2. <view :style="{ minHeight: sys.windowHeight + 'px' }" :class="[$tm.vx.state().tmVuetify.black ? 'black' : ' ']">
  3. <tm-menubars title="" :shadow="0" :showback="false"></tm-menubars>
  4. <view class="C1b1b1b">
  5. <tm-search @click="sosoFun" v-model="soso" color="white" confirm-text=""></tm-search>
  6. <view class="dingwei" v-if="itemuser!=0">
  7. <image class="touxiang" style="vertical-align: middle;" src="/static/img/41.png" mode="widthFix"></image>
  8. <text style="vertical-align: middle;" class="text-size-m mr-20">{{itemuser.username}}的衣橱</text>
  9. <image @click="qiehuanFun" style="vertical-align: middle;" src="/static/img/42.png" mode="widthFix"></image>
  10. <text @click="qiehuanFun" style="vertical-align: middle;" class="text-size-m">切换</text>
  11. </view>
  12. <view class="dingwei" v-if="itemuser==0">
  13. <text style="vertical-align: middle;" class="text-size-m mr-20">暂无家庭成员去添加</text>
  14. <image @click="tianjia" style="vertical-align: middle;" src="/static/img/42.png" mode="widthFix"></image>
  15. </view>
  16. </view>
  17. <!-- 推荐 -->
  18. <view class="zhuti">
  19. <div>
  20. <tm-sheet class="lunbo1 fl" @click="tiao">
  21. <view class="flex-between flex-center">
  22. <view class="tuijian">
  23. <text class="text-white text-size-lg">校园穿搭</text>
  24. </view>
  25. <view >
  26. <text class="text-size-s C929297">详情</text>
  27. </view>
  28. </view>
  29. <view class="flex-between flex-center mt-20 pa-8" style="border-radius: 4px;" :class="[$tm.vx.state().tmVuetify.black ? 'black' : ' ']">
  30. <view class="tuijiantp">
  31. <image style="vertical-align: middle;" src="/static/img/43.png" mode="widthFix"></image>
  32. </view>
  33. <view class="tuijiantp">
  34. <image class="fr" style="vertical-align: middle;" src="/static/img/44.png" mode="widthFix"></image>
  35. </view>
  36. </view>
  37. </tm-sheet>
  38. <tm-sheet class="lunbo1 fr">
  39. <view class="flex-between flex-center">
  40. <view class="tuijian">
  41. <text class="text-white text-size-lg">日常出勤</text>
  42. </view>
  43. <view >
  44. <text class="text-size-s C929297">详情</text>
  45. </view>
  46. </view>
  47. <view class="flex-between flex-center mt-20 pa-8" style="border-radius: 4px;" :class="[$tm.vx.state().tmVuetify.black ? 'black' : ' ']">
  48. <view class="tuijiantp">
  49. <image style="vertical-align: middle;" src="/static/img/43.png" mode="widthFix"></image>
  50. </view>
  51. <view class="tuijiantp">
  52. <image class="fr" style="vertical-align: middle;" src="/static/img/44.png" mode="widthFix"></image>
  53. </view>
  54. </view>
  55. </tm-sheet>
  56. <view style="clear: both;"></view>
  57. </div>
  58. <!-- 衣橱 -->
  59. <tm-sheet class="yichu" style="margin-bottom: 70px !important;">
  60. <tm-tabs class="C1b1b1b qiehuan" @change="fenleichangeFun" color="white" align="left" v-model="activeIndex" :list="list" range-key="title"></tm-tabs>
  61. <view class="yiguicla black pa-6 ma-4 fl" v-for="(item,index) in quanbuList" @longtap="longtap()" @click="xiangqing()">
  62. <image :src="item.thumb" mode="widthFix"></image>
  63. <view class="text-align-center text-size-m mt-8">{{item.brand}}</view>
  64. <view class="text-align-center text-size-m mt-6 mb-6">{{item.goods_name}}</view>
  65. </view>
  66. <view style="clear: both;" class="more ma-30 pt-40" @click="gengmore()">
  67. <image src="/static/img/30.png" mode="widthFix"></image>
  68. <text class="text-size-s">下拉加载更多~</text>
  69. </view>
  70. </tm-sheet>
  71. </view>
  72. <!-- 待取衣服 -->
  73. <css-float-ball v-model="floatBallPosition" >
  74. <view class="float-ball-icon" hover-class="default-icon-hover">
  75. <tm-translate ref="a_1" :auto="true" animation-name="fadeLeft">
  76. <view class="fudong" @click="show_1=true">
  77. <image src="/static/img/96.png" class="fudimg fl"></image>
  78. <view class="pt-20">待取衣物</view>
  79. <view>(<text style="color: #FFCC00;">3</text>件)</view>
  80. </view>
  81. </tm-translate>
  82. </view>
  83. </css-float-ball>
  84. <!-- 弹出 -->
  85. <tm-poup v-model="show_1" :position="pos" class="tcc">
  86. <view style="position: relative !important;">
  87. <view style="height: 10px;"></view>
  88. <tm-swiper :current="1" :indicator-dots="false" :round="6" :ani3d="190" :autoplay="false" :list="list1"></tm-swiper>
  89. <view class="text-white text-align-center mt-15">丝缎质感纹理风衣</view>
  90. <view class="text-white text-align-center mt-10 text-size-s">黑色 - 6518/320</view>
  91. <image class="guayi" src="/static/img/102.png" mode="widthFix"></image>
  92. <view class="text-white text-align-center mt-15">衣物位于 挂衣区 5号衣柜</view>
  93. <view class="text-white text-align-center mt-15">
  94. <image class="aniOn deng" src="/static/img/101.png" mode="widthFix"></image>
  95. <text style="vertical-align: middle;">指示灯已亮,请取出衣柜</text>
  96. </view>
  97. <view class="anniu">
  98. <tm-button @click="quxiao()" theme="gray" size="n">取消</tm-button>
  99. <tm-button @click="chuFun()" class="fr" theme="primary" size="n">确认</tm-button>
  100. </view>
  101. </view>
  102. </tm-poup>
  103. </view>
  104. </template>
  105. <script>
  106. import{myRequest} from '@/api/request.js'
  107. export default {
  108. data() {
  109. return {
  110. show_1:false,
  111. pos:'center',
  112. floatBallPosition:{x: 400, y: 750},
  113. itemuser:0,
  114. soso:'',
  115. activeIndex:0,
  116. list:[],
  117. listlx:[],
  118. quanbuList:[],
  119. list1:[
  120. '../../static/img/100.png',
  121. '../../static/img/100.png',
  122. '../../static/img/100.png',
  123. ],
  124. pagesize:3,
  125. page:1
  126. };
  127. },
  128. onLoad() {
  129. if(!uni.getStorageSync("token")){
  130. uni.navigateTo({
  131. url: "/pages/login/index",
  132. })
  133. }
  134. },
  135. created() {
  136. this.sys = uni.getSystemInfoSync();
  137. this.getfenltext()
  138. this.fenleichange();
  139. },
  140. methods: {
  141. quxiao(){
  142. this.show_1=false;
  143. },
  144. chuFun(){
  145. this.show_1=false;
  146. },
  147. longtap(){
  148. uni.navigateTo({
  149. url: "/pages/changan/index",
  150. })
  151. },
  152. tiao(){
  153. uni.navigateTo({
  154. url: "/pages/zidingyi/index",
  155. })
  156. },
  157. xiangqing(){
  158. uni.navigateTo({
  159. url: "/pages/yifu/index",
  160. })
  161. },
  162. fenleichangeFun(){
  163. var that=this;
  164. myRequest({
  165. url: "/api/Goods/classificationData",
  166. method:'post',
  167. data:{role_id:that.itemuser.id,id:that.activeIndex,page:that.page,pagesize:that.pagesize}
  168. }).then(res => {
  169. if (res.data.code == 200) {
  170. if(res.data.data.length != 0){
  171. that.quanbuList=res.data.data.data;
  172. }
  173. }else{
  174. that.quanbuList=[];
  175. }
  176. })
  177. },
  178. sosoFun(){
  179. uni.navigateTo({
  180. url: "/pages/shopsoso/index",
  181. })
  182. },
  183. fenleichange(){
  184. var that=this;
  185. myRequest({
  186. url: "/api/MemberInfo/getFamilyMember",
  187. method:'post',
  188. data:{family_id:uni.getStorageSync("family_id")}
  189. }).then(res => {
  190. if (res.data.code == 200) {
  191. if(res.data.data.length != 0){
  192. var wu=0;
  193. for(let i=0;i<res.data.data.length;i++){
  194. if(res.data.data[i].checked==1){
  195. wu=1;
  196. that.itemuser=res.data.data[i];
  197. }
  198. }
  199. if(wu==0){
  200. that.itemuser=res.data.data[0];
  201. }
  202. this.fenleichangeFun()
  203. }else{
  204. that.itemuser=0;
  205. }
  206. }else{
  207. that.itemuser=0;
  208. }
  209. })
  210. },
  211. getfenltext(){
  212. var that=this;
  213. myRequest({
  214. url: "/api/Category/list",
  215. method:'post',
  216. data:{}
  217. }).then(res => {
  218. if (res.data.code == 200) {
  219. if(res.data.data.length != 0){
  220. that.list=['全部'];
  221. for(let i=0;i<res.data.data.length;i++){
  222. that.list.push(res.data.data[i].category_name)
  223. }
  224. that.listlx=res.data.data;
  225. }
  226. }else{
  227. that.list=[];
  228. that.listlx=[];
  229. }
  230. })
  231. },
  232. qiehuanFun(){
  233. uni.navigateTo({
  234. url: "/pages/qiehuan/index",
  235. })
  236. },
  237. gengmore(){
  238. var that=this;
  239. that.page=that.page+1;
  240. this.fenleichangeFun();
  241. },
  242. tianjia(){
  243. uni.navigateTo({
  244. url: "/pages/chuanghome/index",
  245. })
  246. }
  247. },
  248. }
  249. </script>
  250. <style lang="scss">
  251. /deep/ uni-scroll-view{
  252. height: auto !important;
  253. }
  254. /deep/ .tm-menubars .body{
  255. background-color: #1b1b1b !important;
  256. }
  257. .shangright{
  258. padding: 10px;
  259. }
  260. //
  261. .xiangji image{
  262. width: 30px;
  263. height: 22px;
  264. }
  265. .suosou image{
  266. width: 40px;
  267. }
  268. /deep/ .icon-search{
  269. font-size: 23px !important;
  270. color: #8E8E93 !important;
  271. }
  272. /deep/ .tm-search{
  273. width: 94%;
  274. margin: 0 auto;
  275. background-color: #414141 !important;
  276. border-radius: 10px;
  277. }
  278. /deep/ .tm-search .grey-darken-5{
  279. background-color: #414141 !important;
  280. }
  281. .dingwei{width: 92%;margin: 0 auto;margin-top: 20px;padding-bottom: 20px;}
  282. .dingwei image{width: 25px;margin-right: 10px; }
  283. .dingwei .touxiang{width: 50px;margin-right: 3px; }
  284. /deep/ .lunbo1{margin:0 !important;padding: 4px !important;margin-top: 5px !important;width: 46.6% !important;}
  285. .tuijiantp{width: 100%;}
  286. .tuijiantp image{width: 97% !important;}
  287. .yichu{margin:0 !important;padding: 4px !important;margin-top: 10px !important;}
  288. /deep/ .qiehuan .text-white{
  289. font-size: 14px;
  290. background: #303440;
  291. height: 28px;
  292. vertical-align: middle;
  293. line-height: 28px;
  294. border-radius: 20px;
  295. padding-left: 14px;
  296. padding-right: 14px;
  297. margin-top: 17%;
  298. }
  299. /deep/ .qiehuan .tm-tabs-con-item-border{display: none;}
  300. .yiguicla image{width: 95%;display: block;margin: 0 auto;margin-top: 5px;height: 90px;}
  301. .yiguicla{width: 30%;border-radius: 10px;}
  302. .more{text-align: center;}
  303. .more image{margin-right: 10px;vertical-align: middle;width: 30px;}
  304. .fudong{position:fixed;right:10px;bottom:150px;background: #303030;width: 130px;height: 60px;
  305. border-radius: 30px 0px 0px 30px;font-size: 14px;text-align: center;}
  306. .fudimg{width: 60px;height:60px}
  307. /deep/ .tcc .tm-poup-wk{width: 90% !important;position:relative;height: 580px !important;}
  308. /deep/ .tcc .uni-swiper-slides{width: 100%;}
  309. /deep/ .tcc uni-swiper{width: 100% !important;}
  310. /deep/ .uni-swiper-slides{width: 160px !important;}
  311. /deep/ .tcc uni-image{width: 160px !important;}
  312. .tcc .guayi{width: 90% !important;display: block;margin:0 auto;margin-top:15px !important;}
  313. .tcc .deng{width:25px !important;height:25px !important;vertical-align: middle;margin-right:8px;}
  314. .anniu{width: 80%;margin: 0 auto;margin-top: 20px;}
  315. /deep/ .anniu .gray.bk{color: white !important;}
  316. .aniOn{
  317. animation:doudong 0.5s linear infinite;
  318. background:linear-gradient();
  319. background: -webkit-linear-gradient();
  320. }
  321. @keyframes doudong {
  322. 0%{
  323. transform: rotate(-2deg) translateX(2rpx) translateY(2rpx);
  324. }
  325. 25%{
  326. transform: rotate(0deg) translateX(-2rpx) translateY(-2rpx);
  327. }
  328. 50%{
  329. transform: rotate(0deg) translateX(0rpx) translateY(-2rpx);
  330. }
  331. 75%{
  332. transform: rotate(0deg) translateX(0rpx) translateY(2rpx);
  333. }
  334. 100%{
  335. transform: rotate(-2deg) translateX(2rpx) translateY(2rpx);
  336. }
  337. }
  338. </style>