兼兼街公众号代码
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

262 lines
6.1 KiB

  1. <template>
  2. <view class="my-pages">
  3. <view class="temps-box">
  4. <view class="head-mode" >
  5. <u--image shape="circle" :src="userInfo?userInfo.headImage : morenSrc" width="149rpx" height="149rpx" @click="toLogin"></u--image>
  6. <view class="head-name" @click="toLogin">{{userInfo?userInfo.nickName : '未登录'}}</view>
  7. <!-- <view @click="toPrice"> {{userInfo?'余额:'+userInfo.price : ''}}</view> -->
  8. <view class="head-name" @click="toInteger">{{userInfo?'积分:'+userInfo.integerPrice : ''}}</view>
  9. </view>
  10. <view class="btns">
  11. <view class="btns-context" v-for="(item,i) in cellList" :key="i" @click="toUrl(item.pages,item.name)">
  12. <image style="width: 60rpx;height: 60rpx; padding: 40rpx 40rpx;" :src="item.src" mode=""></image>
  13. <view style="padding: 54rpx 0;">{{item.name}}</view>
  14. <view style="margin-left: auto; padding: 55rpx 40rpx;">
  15. <view class="menu-after"></view>
  16. </view>
  17. </view>
  18. </view>
  19. <view class="kefu-box">
  20. <view class="kefu">
  21. <view class="image">
  22. <image class="image-img" src="../../static/kefu.png" @click="previewImg('../../static/kefu.png')" mode=""></image>
  23. </view>
  24. </view>
  25. <view class="kefufont"> @湖南瀚海黎明信息科技有限公司提供技术支持 </view>
  26. </view>
  27. </view>
  28. </view>
  29. </template>
  30. <script>
  31. export default{
  32. data(){
  33. return{
  34. userInfo:null,
  35. role:0,//2销售商
  36. morenSrc:require('@/static/img/logon-icon.png'),
  37. cellList: [
  38. {
  39. name:'邀请二维码',
  40. src:require('@/static/img/info/code.png'),
  41. role:'0',
  42. pages:'/pages/my/my-xiansuo-new'
  43. },
  44. {
  45. name:'我的粉丝',
  46. src:require('@/static/img/info/fans.png'),
  47. role:'0',
  48. pages:'/pages/my/list-fensi'
  49. },
  50. {
  51. name:'我要发布',
  52. src:require('@/static/img/tabbar/add.png'),
  53. role:'0',
  54. pages:'/pages/my/my-fabujianzhi'
  55. },
  56. {
  57. name:'发布信息',
  58. src:require('@/static/img/tabbar/xinxi.png'),
  59. role:'0',
  60. pages:'/pages/my/my-fabujianzhi-list'
  61. },
  62. {
  63. name:'订单列表',
  64. src:require('@/static/img/tabbar/order.png'),
  65. role:'0',
  66. pages:'/pages/my/my-order-list'
  67. },
  68. {
  69. name:'地址列表',
  70. src:require('@/static/img/tabbar/address.png'),
  71. role:'0',
  72. pages:'/pages/my/my-address-list'
  73. },
  74. {
  75. name:'增加地址',
  76. src:require('@/static/img/tabbar/fabu-xuan.png'),
  77. role:'0',
  78. pages:'/pages/my/my-addre'
  79. }
  80. ]
  81. }
  82. },
  83. onShow() {
  84. this.getmyInfo()
  85. },
  86. // 隐藏微信h5的标题栏
  87. onReady() {
  88. this.$com.displayNav()
  89. },
  90. methods:{
  91. previewImg(imageUrl){
  92. var images = [];
  93. images.push(imageUrl);
  94. console.log(images) // ["http://192.168.100.251:8970/6_1597822634094.png"]
  95. uni.previewImage({ // 预览图片 图片路径必须是一个数组 => ["http://192.168.100.251:8970/6_1597822634094.png"]
  96. current:0,
  97. urls:images,
  98. longPressActions: { //长按保存图片到相册
  99. itemList: ['保存图片'],
  100. success: (data)=> {
  101. console.log(data);
  102. uni.saveImageToPhotosAlbum({ //保存图片到相册
  103. filePath: payUrl,
  104. success: function () {
  105. uni.showToast({icon:'success',title:'保存成功'})
  106. },
  107. fail: (err) => {
  108. uni.showToast({icon:'none',title:'保存失败,请重新尝试'})
  109. }
  110. });
  111. },
  112. fail: (err)=> {
  113. console.log(err.errMsg);
  114. }
  115. }
  116. });
  117. },
  118. getmyInfo(){
  119. this.$api('myInfo')
  120. .then(res=>{
  121. if(res.code == 200){
  122. this.role = res.result.role;
  123. this.userInfo = res.result;
  124. this.$store.commit('set_userInfo',res.result)
  125. }else{
  126. this.userInfo = null
  127. }
  128. })
  129. },
  130. toPrice(){
  131. uni.navigateTo({
  132. url:'/pages/my/list-price'
  133. })
  134. },
  135. toInteger(){
  136. uni.navigateTo({
  137. url:'/pages/my/list-integer'
  138. })
  139. },
  140. toUrl(url,name){
  141. this.$api('myInfo')
  142. .then(res=>{
  143. if(res.code == 200){
  144. this.role = res.result.role;
  145. this.userInfo = res.result;
  146. this.$store.commit('set_userInfo',res.result)
  147. uni.navigateTo({
  148. url
  149. })
  150. // if(name=='邀请二维码' || name=='我的粉丝' || name=='实名认证' || name=='我要发布'){
  151. // }else{
  152. // this.$Toast('未开放,敬请期待!')
  153. // }
  154. }else{
  155. this.$Toast('请先登录!')
  156. setTimeout(()=>{
  157. uni.navigateTo({
  158. url:'/pages/my/login-kehu'
  159. })
  160. },1000)
  161. return
  162. this.userInfo = null
  163. }
  164. })
  165. },
  166. toLogin(){
  167. if(!this.userInfo){
  168. uni.navigateTo({
  169. url:"/pages/my/login-kehu"
  170. })
  171. }else{
  172. uni.navigateTo({
  173. url:'/pages/my/edit-user'
  174. })
  175. }
  176. }
  177. }
  178. }
  179. </script>
  180. <style lang="scss" scoped>
  181. .my-pages {
  182. background: url("@/static/2.png");
  183. background-size: 100% 100%;
  184. width: 100vw;
  185. height: calc(100vh - 80rpx);
  186. }
  187. .temps-box {
  188. //background-color: #00CCCC;
  189. height: 538rpx;
  190. .head-mode {
  191. display: flex;
  192. justify-items: center;
  193. height:168rpx;
  194. padding: 50rpx 20rpx 20rpx 20rpx;
  195. //background-color: #00CCCC;
  196. .head-name {
  197. padding: 38rpx;
  198. font-size: 40rpx;
  199. font-weight: 600;
  200. font-family: SimSun;
  201. }
  202. }
  203. .btns {
  204. margin-top: 15rpx;
  205. background-color: #FFFFFF;
  206. .btns-context {
  207. height: 120rpx;
  208. display:flex;
  209. border-bottom:1px solid #F7F7F7;
  210. }
  211. }
  212. .kefu-box {
  213. position: absolute;
  214. bottom: 1px;
  215. .kefu{
  216. width: 100vw;
  217. display: flex;
  218. text-align: center;
  219. justify-items: center;
  220. .image{
  221. display: flex;
  222. margin: 0 auto;
  223. text-align: center;
  224. justify-items: center;
  225. }
  226. }
  227. .kefufont{
  228. padding: 20rpx 0;
  229. width: 100%;
  230. position: absolute;
  231. font-size: 20rpx;
  232. text-align:center;
  233. color: #5E5E5E;
  234. }
  235. .image-img {
  236. width: 130rpx;
  237. height: 130rpx;
  238. }
  239. }
  240. .menu-after {
  241. width: 15rpx;
  242. height: 15rpx;
  243. border-right: 3rpx solid #808080;
  244. border-bottom: 3rpx solid #808080;
  245. transform:rotate(-45deg);
  246. }
  247. }
  248. </style>