index.vue 11 KB

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