123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431 |
- <template>
- <div>
- <div class="weatherDay7" :style="{'margin-left':marginleft}">
- <div :key="index" class="weatherParentComponent" :style="{'width':width7}" @tap="changeTap(item)" v-for="(item,index) in weatherProphetData_7">
- <div :class="[classNameweatherIconBackgroundColor,bgcolor]" :style="{'width':assemblyWidth,'height':assemblyHeight}">
- <div class="assembly_time l" :style="{'margin-left':timeleft}"> {{ utils.timeTodate('d', item.recodedata) }}日</div>
- <!--<div class="today_time l">今天</div>-->
- <div :class="[classNameDay[index],assembly_1_page]" :style="{'margin-left':tuleft}"></div>
- <div :class="[classNameNight[index],assembly_2_page]" :style="{'margin-left':tuleft}"></div>
- <div class="assembly_weather l" :style="{'margin-left':weatherleft}">{{item.weather}}</div>
- <div class="assembly_temperature l" :style="{'margin-left':temperleft}">{{item.temperature2}}~{{item.temperature1}}℃</div>
- <div class="assembly_wind l" :style="{'margin-left':weatherleft}">{{item.speed1}}km/h</div>
- </div>
- </div>
- </div>
- </div>
- </template>
- <script>
- import utils from '@/components/tools/shoyu-date/utils.filter.js';
- export default {
- data: function() {
- return {
- classNameweatherIconBackgroundColor: [],
- bgcolor: "lightBlue",
- assemblyWidth: '',
- assemblyHeight: '',
- weatherProphetData_7: [],
- assembly_1_page: "assembly_1",
- classNameDay: [],
- classNameNight: [],
- assembly_2_page: "assembly_2",
- weatherIconsDay:[],
- weatherIconsNight:[],
- // 直接使用需要进行声明
- utils: utils,
- // 直接使用需要进行声明 End
- timestamp: "",
- windowWidth:"",
- windowHeight:"",
- marginleft:'',
- width7:'',
- timeleft:'',
- tuleft:'',
- weatherleft:'',
- temperleft:'',
- }
- },
- created: function() {
- this.windowWidth=uni.getSystemInfoSync().windowWidth;
- this.windowHeight=uni.getSystemInfoSync().windowHeight;
- if(this.windowWidth>=768){
- this.marginleft="5%";
- this.width7="150px";
- this.timeleft="30px";
- this.tuleft="62px";
- this.weatherleft="27px"
- this.temperleft="28px";
- }else{
- this.marginleft="20px";
- }
- },
- methods: {
- changeTap: function(item) {
- let itemString = JSON.stringify(item);
- this.$emit("listenEven", itemString);
- },
- setDate: function() {
- // var newDate = new Date(this.weatherProphetData_40.recodedata).Format("dd");
- // this.newDate = newDate;
- this.timestamp = new Date(this.weatherProphetData_7.recodedata).getTime();
- this.newDate = this.utils.timeTodate('d', this.timestamp);
- // this.timestamp = 1582560000000;
- // console.log(this.timestamp);
- },
- weatherInformationCard: function(assemblyWidth, assemblyHeight, classNameDay, classNameNight, weatherProphetData_7) {
- //console.log(this.weatherProphetData_7);
- let _this = this;
- this.assemblyWidth = assemblyWidth + "px";;
- this.assemblyHeight = assemblyHeight + "%";
- this.classNameDay = classNameDay;
- this.classNameNight = classNameNight;
- this.weatherIconsDay = [];
- this.weatherIconsNight = [];
- this.weatherProphetData_7 = weatherProphetData_7;
- for (let i = 0; i < _this.weatherProphetData_7.length; i++) {
- _this.weatherIconsDay.push(_this.weatherProphetData_7[i].weather1);
- _this.weatherIconsNight.push(_this.weatherProphetData_7[i].weather2);
- // console.log(_this.weatherIconsNight)
- }
- uni.request({
- url: 'http://49.4.78.143:8081/WeatherfdController/weatherInformationChangePictureName?model=weatherProphet_7,weatherDataTable_7,white30&weatherInformation=' +
- this.weatherIconsDay,
- success: function(res) {
- _this.classNameDay = [];
- for (let i = 0; i < res.data.length; i++) {
- _this.classNameDay.push(res.data[i]);
- }
- },
- fail: (e) => {
- _this.tips = "网络错误"
- },
- });
- uni.request({
- url:'http://49.4.78.143:8081/WeatherfdController/weatherInformationChangePictureName?model=weatherProphet_7,weatherDataTable_7,white30&weatherInformation=' + this.weatherIconsNight,
- success: function(res) {
- _this.classNameNight = [];
- for (let i = 0; i < res.data.length; i++) {
- _this.classNameNight.push(res.data[i]);
- }
- // console.log(_this.classNameNight)
- },
- fail: (e) => {
- _this.tips = "网络错误"
- },
- });
- this.setDate();
- this.changeTap(this.weatherProphetData_7[0]);
- },
- },
- }
- </script>
- <style scoped="scoped">
- .assembly_time {
- height: 23px;
- width: 100%;
- border: 0px;
- font-size: 16px;
- margin-top: 5%;
- color: #FFF;
- text-decoration: none;
- font-family: "Microsoft Yahei", Arial, Helvetica, sans-serif;
- text-align: center;
- }
- .assembly_2 {
- height: 31px;
- width: 31px;
- border: 0px;
- margin-top: 10%;
- margin-left: 35%;
- background-position: 0px 0px;
- }
- .assembly_1 {
- height: 31px;
- width: 31px;
- border: 0px;
- margin-top: 10%;
- margin-left: 35%;
- background-position: 0px 80px;
- }
- .assembly_weather {
- height: 23px;
- width: 100%;
- border: 0px;
- font-size: 16px;
- color: #FFF;
- text-decoration: none;
- font-family: "Microsoft Yahei", Arial, Helvetica, sans-serif;
- text-align: center;
- margin-top: 30px;
- font-weight: bold;
- }
- .assembly_temperature {
- height: 23px;
- width: 100%;
- border: 0px;
- font-size: 16px;
- color: #FFF;
- text-decoration: none;
- font-family: "Microsoft Yahei", Arial, Helvetica, sans-serif;
- text-align: center;
- margin-top: 15%;
- font-weight: bold;
- }
- .assembly_wind {
- height: 23px;
- width: 100%;
- border: 0px;
- font-size: 16px;
- color: #FFF;
- text-decoration: none;
- font-family: "Microsoft Yahei", Arial, Helvetica, sans-serif;
- text-align: center;
- margin-top: 15%;
- font-weight: normal;
- }
- .weatherParentComponent {
- border-right: 1rpx solid white;
- border-left: 1rpx solid white;
- /* border:1px solid white; */
-
- }
- .weatherDay7 {
- width: 90%;
- height: 260px;
- /* background: -webkit-gradient(linear, 0% 0%, 0% 100%, from(#024F93), color-stop(1.5, #cccccc), to(#437193)); */
- background-color: #242424;
- float: left;
- /* margin: 0px auto; */
- /* border-radius: 20px; */
- margin-top: 5px;
- margin-left: 20px;
- margin-bottom: 20px;
- margin-right: 20px;
- display: -webkit-box;
- overflow-x: auto;
- /* position:fixed; */
- /*适应苹果*/
- -webkit-overflow-scrolling: touch;
- }
- .weatherProphet_7_weatherDataTable_7_white30_taiYang {
- background: url(../../../../static/picture/weatherTemperatureWindSpeedCard_7/white30.png) no-repeat 0px 0px;
- }
- .weatherProphet_7_weatherDataTable_7_white30_yunShui {
- background: url(../../../../static/picture/weatherTemperatureWindSpeedCard_7/white30.png) no-repeat -560px 0px;
- }
- .weatherProphet_7_weatherDataTable_7_white30_yunYun {
- background: url(../../../../static/picture/weatherTemperatureWindSpeedCard_7/white30.png) no-repeat -160px 0px;
- }
- .weatherProphet_7_weatherDataTable_7_white30_taiYang {
- background: url(../../../../static/picture/weatherTemperatureWindSpeedCard_7/white30.png) no-repeat 0px 0px;
- }
- .weatherProphet_7_weatherDataTable_7_white30_taiYangYun {
- background: url(../../../../static/picture/weatherTemperatureWindSpeedCard_7/white30.png) no-repeat 0px 0px;
- }
- .weatherProphet_7_weatherDataTable_7_white30_yunYun {
- background: url(../../../../static/picture/weatherTemperatureWindSpeedCard_7/white30.png) no-repeat -160px 0px;
- }
- .weatherProphet_7_weatherDataTable_7_white30_taiYangYunShui {
- background: url(../../../../static/picture/weatherTemperatureWindSpeedCard_7/white30.png) no-repeat -238px 0px;
- }
- .weatherProphet_7_weatherDataTable_7_white30_taiYangShanDianShui {
- background: url(../../../../static/picture/weatherTemperatureWindSpeedCard_7/white30.png) no-repeat -314px 0px;
- }
- .weatherProphet_7_weatherDataTable_7_white30_taiYangShanDianShuiShui {
- background: url(../../../../static/picture/weatherTemperatureWindSpeedCard_7/white30.png) no-repeat -396px 0px;
- }
- .weatherProphet_7_weatherDataTable_7_white30_yunShuiXue {
- background: url(../../../../static/picture/weatherTemperatureWindSpeedCard_7/white30.png) no-repeat -480px 0px;
- }
- .weatherProphet_7_weatherDataTable_7_white30_yunLiangShui {
- background: url(../../../../static/picture/weatherTemperatureWindSpeedCard_7/white30.png) no-repeat -638px 0px;
- }
- .weatherProphet_7_weatherDataTable_7_white30_sanHengGang {
- background: url(../../../../static/picture/weatherTemperatureWindSpeedCard_7/white30.png) no-repeat -718px 0px;
- }
- .weatherProphet_7_weatherDataTable_7_white30_liangDianLiangQuan {
- background: url(../../../../static/picture/weatherTemperatureWindSpeedCard_7/white30.png) no-repeat -798px 0px;
- }
- .weatherProphet_7_weatherDataTable_7_white30_yunYunShuiShui {
- background: url(../../../../static/picture/weatherTemperatureWindSpeedCard_7/white30.png) no-repeat -880px 0px;
- }
- .weatherProphet_7_weatherDataTable_7_white30_yunSanShui {
- background: url(../../../../static/picture/weatherTemperatureWindSpeedCard_7/white30.png) no-repeat 0px -76px;
- }
- .weatherProphet_7_weatherDataTable_7_white30_yunYunSiShui {
- background: url(../../../../static/picture/weatherTemperatureWindSpeedCard_7/white30.png) no-repeat -76px -76px;
- }
- .weatherProphet_7_weatherDataTable_7_white30_yunYunWuShui {
- background: url(../../../../static/picture/weatherTemperatureWindSpeedCard_7/white30.png) no-repeat -152px -76px;
- }
- .weatherProphet_7_weatherDataTable_7_white30_yunYunLiuShui {
- background: url(../../../../static/picture/weatherTemperatureWindSpeedCard_7/white30.png) no-repeat -232px -76px;
- }
- .weatherProphet_7_weatherDataTable_7_white30_taiYangYunXueXue {
- background: url(../../../../static/picture/weatherTemperatureWindSpeedCard_7/white30.png) no-repeat -314px -76px;
- }
- .weatherProphet_7_weatherDataTable_7_white30_yunXue {
- background: url(../../../../static/picture/weatherTemperatureWindSpeedCard_7/white30.png) no-repeat -396px -76px;
- }
- .weatherProphet_7_weatherDataTable_7_white30__yunXueXue {
- background: url(../../../../static/picture/weatherTemperatureWindSpeedCard_7/white30.png) no-repeat -476px -76px;
- }
- .weatherProphet_7_weatherDataTable_7_white30_yunSanXue {
- background: url(../../../../static/picture/weatherTemperatureWindSpeedCard_7/white30.png) no-repeat -556px -76px;
- }
- .weatherProphet_7_weatherDataTable_7_white30_yunYunSiXue {
- background: url(../../../../static/picture/weatherTemperatureWindSpeedCard_7/white30.png) no-repeat -638px -76px;
- }
- .weatherProphet_7_weatherDataTable_7_white30_sanHengGang {
- background: url(../../../../static/picture/weatherTemperatureWindSpeedCard_7/white30.png) no-repeat -718px -76px;
- }
- .weatherProphet_7_weatherDataTable_7_white30_sanDianSanQuan {
- background: url(../../../../static/picture/weatherTemperatureWindSpeedCard_7/white30.png) no-repeat -798px -76px;
- }
- .weatherProphet_7_weatherDataTable_7_white30_yunYunXueXue {
- background: url(../../../../static/picture/weatherTemperatureWindSpeedCard_7/white30.png) no-repeat -876px -76px;
- }
- .weatherProphet_7_weatherDataTable_7_white30_sanHengGang {
- background: url(../../../../static/picture/weatherTemperatureWindSpeedCard_7/white30.png) no-repeat 0px -152px;
- }
- .weatherProphet_7_weatherDataTable_7_white30_boLang {
- background: url(../../../../static/picture/weatherTemperatureWindSpeedCard_7/white30.png) no-repeat -76px -152px;
- }
- .weatherProphet_7_weatherDataTable_7_white30_sYouJianTou {
- background: url(../../../../static/picture/weatherTemperatureWindSpeedCard_7/white30.png) no-repeat -152px -152px;
- }
- .weatherProphet_7_weatherDataTable_7_white30_yunShuiShui {
- background: url(../../../../static/picture/weatherTemperatureWindSpeedCard_7/white30.png) no-repeat -232px -152px;
- }
- .weatherProphet_7_weatherDataTable_7_white30_yunSanShui {
- background: url(../../../../static/picture/weatherTemperatureWindSpeedCard_7/white30.png) no-repeat -314px -152px;
- }
- .weatherProphet_7_weatherDataTable_7_white30_yunYunSiShui {
- background: url(../../../../static/picture/weatherTemperatureWindSpeedCard_7/white30.png) no-repeat -396px -152px;
- }
- .weatherProphet_7_weatherDataTable_7_white30_yunYunWuShui {
- background: url(../../../../static/picture/weatherTemperatureWindSpeedCard_7/white30.png) no-repeat -476px -152px;
- }
- .weatherProphet_7_weatherDataTable_7_white30_yunYunLiuShui {
- background: url(../../../../static/picture/weatherTemperatureWindSpeedCard_7/white30.png) no-repeat -556px -152px;
- }
- .weatherProphet_7_weatherDataTable_7_white30_yunXueXue {
- background: url(../../../../static/picture/weatherTemperatureWindSpeedCard_7/white30.png) no-repeat -638px -152px;
- }
- .weatherProphet_7_weatherDataTable_7_white30_yunSanXue {
- background: url(../../../../static/picture/weatherTemperatureWindSpeedCard_7/white30.png) no-repeat 0px -232px;
- }
- .weatherProphet_7_weatherDataTable_7_white30_yunYunSiXue {
- background: url(../../../../static/picture/weatherTemperatureWindSpeedCard_7/white30.png) no-repeat -76px -232px;
- }
- .weatherProphet_7_weatherDataTable_7_white30_s {
- background: url(../../../../static/picture/weatherTemperatureWindSpeedCard_7/white30.png) no-repeat -152px -232px;
- }
- .weatherProphet_7_weatherDataTable_7_white30_sShangJianTou {
- background: url(../../../../static/picture/weatherTemperatureWindSpeedCard_7/white30.png) no-repeat -232px -232px;
- }
- .weatherProphet_7_weatherDataTable_7_white30_sYouJianTou {
- background: url(../../../../static/picture/weatherTemperatureWindSpeedCard_7/white30.png) no-repeat -314px -232px;
- }
- .weatherProphet_7_weatherDataTable_7_white30_yunShuiShui {
- background: url(../../../../static/picture/weatherTemperatureWindSpeedCard_7/white30.png) no-repeat -396px -232px;
- }
- .weatherProphet_7_weatherDataTable_7_white30_yunXueXue {
- background: url(../../../../static/picture/weatherTemperatureWindSpeedCard_7/white30.png) no-repeat -476px -232px;
- }
- .weatherProphet_7_weatherDataTable_7_white30_yueLiang {
- background: url(../../../../static/picture/weatherTemperatureWindSpeedCard_7/white30.png) no-repeat 0px -314px;
- }
- .weatherProphet_7_weatherDataTable_7_white30_yueLiangYun {
- background: url(../../../../static/picture/weatherTemperatureWindSpeedCard_7/white30.png) no-repeat -76px -314px;
- }
- .weatherProphet_7_weatherDataTable_7_white30_yunYueLiangYun {
- background: url(../../../../static/picture/weatherTemperatureWindSpeedCard_7/white30.png) no-repeat -152px -314px;
- }
- .weatherProphet_7_weatherDataTable_7_white30_yueLiangYunShui {
- background: url(../../../../static/picture/weatherTemperatureWindSpeedCard_7/white30.png) no-repeat -232px -314px;
- }
- .weatherProphet_7_weatherDataTable_7_white30_yunShanDianShui {
- background: url(../../../../static/picture/weatherTemperatureWindSpeedCard_7/white30.png) no-repeat -314px -314px;
- }
- .weatherProphet_7_weatherDataTable_7_white30_yueShanDianShuiShui {
- background: url(../../../../static/picture/weatherTemperatureWindSpeedCard_7/white30.png) no-repeat -396px -314px;
- }
- .weatherProphet_7_weatherDataTable_7_white30_yunShuiXue {
- background: url(../../../../static/picture/weatherTemperatureWindSpeedCard_7/white30.png) no-repeat -481px -318px;
- }
- .weatherProphet_7_weatherDataTable_7_white30_yunShuiShui {
- background: url(../../../../static/picture/weatherTemperatureWindSpeedCard_7/white30.png) no-repeat -638px -314px;
- }
- .weatherProphet_7_weatherDataTable_7_white30_yunYunShuiShui {
- background: url(../../../../static/picture/weatherTemperatureWindSpeedCard_7/white30.png) no-repeat -876px -314px;
- }
- .weatherProphet_7_weatherDataTable_7_white30_yueLiangYunXueXue {
- background: url(../../../../static/picture/weatherTemperatureWindSpeedCard_7/white30.png) no-repeat -314px -396px;
- }
- </style>
|